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