@@ -217,6 +217,17 @@ class Path:
217
217
It implements the Python 3.10 version of :class:`pathlib.Path` interface, except for
218
218
the deprecated :meth:`~pathlib.Path.link_to` method.
219
219
220
+ Some methods may be unavailable or have limited functionality, based on the Python
221
+ version:
222
+
223
+ * :meth:`~pathlib.Path.from_uri` (available on Python 3.13 or later)
224
+ * :meth:`~pathlib.Path.full_match` (available on Python 3.13 or later)
225
+ * :meth:`~pathlib.Path.match` (the ``case_sensitive`` paramater is only available on
226
+ Python 3.13 or later)
227
+ * :meth:`~pathlib.Path.relative_to` (the ``walk_up`` parameter is only available on
228
+ Python 3.12 or later)
229
+ * :meth:`~pathlib.Path.walk` (available on Python 3.12 or later)
230
+
220
231
Any methods that do disk I/O need to be awaited on. These methods are:
221
232
222
233
* :meth:`~pathlib.Path.absolute`
@@ -232,7 +243,10 @@ class Path:
232
243
* :meth:`~pathlib.Path.is_dir`
233
244
* :meth:`~pathlib.Path.is_fifo`
234
245
* :meth:`~pathlib.Path.is_file`
246
+ * :meth:`~pathlib.Path.is_junction`
235
247
* :meth:`~pathlib.Path.is_mount`
248
+ * :meth:`~pathlib.Path.is_socket`
249
+ * :meth:`~pathlib.Path.is_symlink`
236
250
* :meth:`~pathlib.Path.lchmod`
237
251
* :meth:`~pathlib.Path.lstat`
238
252
* :meth:`~pathlib.Path.mkdir`
@@ -243,11 +257,14 @@ class Path:
243
257
* :meth:`~pathlib.Path.readlink`
244
258
* :meth:`~pathlib.Path.rename`
245
259
* :meth:`~pathlib.Path.replace`
260
+ * :meth:`~pathlib.Path.resolve`
246
261
* :meth:`~pathlib.Path.rmdir`
247
262
* :meth:`~pathlib.Path.samefile`
248
263
* :meth:`~pathlib.Path.stat`
264
+ * :meth:`~pathlib.Path.symlink_to`
249
265
* :meth:`~pathlib.Path.touch`
250
266
* :meth:`~pathlib.Path.unlink`
267
+ * :meth:`~pathlib.Path.walk`
251
268
* :meth:`~pathlib.Path.write_bytes`
252
269
* :meth:`~pathlib.Path.write_text`
253
270
@@ -385,9 +402,6 @@ def is_relative_to(self, other: str | PathLike[str]) -> bool:
385
402
except ValueError :
386
403
return False
387
404
388
- async def is_junction (self ) -> bool :
389
- return await to_thread .run_sync (self ._path .is_junction )
390
-
391
405
async def chmod (self , mode : int , * , follow_symlinks : bool = True ) -> None :
392
406
func = partial (os .chmod , follow_symlinks = follow_symlinks )
393
407
return await to_thread .run_sync (func , self ._path , mode )
@@ -447,6 +461,11 @@ async def is_fifo(self) -> bool:
447
461
async def is_file (self ) -> bool :
448
462
return await to_thread .run_sync (self ._path .is_file , abandon_on_cancel = True )
449
463
464
+ if sys .version_info >= (3 , 12 ):
465
+
466
+ async def is_junction (self ) -> bool :
467
+ return await to_thread .run_sync (self ._path .is_junction )
468
+
450
469
async def is_mount (self ) -> bool :
451
470
return await to_thread .run_sync (
452
471
os .path .ismount , self ._path , abandon_on_cancel = True
0 commit comments