Skip to content

Commit 87edeb6

Browse files
authored
os.path etc: update for py313 (#11965)
1 parent 2756f16 commit 87edeb6

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

stdlib/genericpath.pyi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ __all__ = [
2020
]
2121
if sys.version_info >= (3, 12):
2222
__all__ += ["islink"]
23+
if sys.version_info >= (3, 13):
24+
__all__ += ["isjunction", "isdevdrive", "lexists"]
2325

2426
# All overloads can return empty string. Ideally, Literal[""] would be a valid
2527
# Iterable[T], so that list[T] | Literal[""] could be used as a return
@@ -50,3 +52,8 @@ def getctime(filename: FileDescriptorOrPath) -> float: ...
5052
def samefile(f1: FileDescriptorOrPath, f2: FileDescriptorOrPath) -> bool: ...
5153
def sameopenfile(fp1: int, fp2: int) -> bool: ...
5254
def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ...
55+
56+
if sys.version_info >= (3, 13):
57+
def isjunction(path: StrOrBytesPath) -> bool: ...
58+
def isdevdrive(path: StrOrBytesPath) -> bool: ...
59+
def lexists(path: StrOrBytesPath) -> bool: ...

stdlib/ntpath.pyi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from _typeshed import BytesPath, StrPath
2+
from _typeshed import BytesPath, StrOrBytesPath, StrPath
33
from genericpath import (
44
commonprefix as commonprefix,
55
exists as exists,
@@ -47,6 +47,8 @@ from typing_extensions import LiteralString
4747

4848
if sys.version_info >= (3, 12):
4949
from posixpath import isjunction as isjunction, splitroot as splitroot
50+
if sys.version_info >= (3, 13):
51+
from genericpath import isdevdrive as isdevdrive
5052

5153
__all__ = [
5254
"normcase",
@@ -90,6 +92,8 @@ __all__ = [
9092
]
9193
if sys.version_info >= (3, 12):
9294
__all__ += ["isjunction", "splitroot"]
95+
if sys.version_info >= (3, 13):
96+
__all__ += ["isdevdrive", "isreserved"]
9397

9498
altsep: LiteralString
9599

@@ -117,3 +121,6 @@ if sys.platform == "win32":
117121

118122
else:
119123
realpath = abspath
124+
125+
if sys.version_info >= (3, 13):
126+
def isreserved(path: StrOrBytesPath) -> bool: ...

stdlib/posixpath.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ from genericpath import (
1414
sameopenfile as sameopenfile,
1515
samestat as samestat,
1616
)
17+
18+
if sys.version_info >= (3, 13):
19+
from genericpath import isdevdrive as isdevdrive
1720
from os import PathLike
1821
from typing import AnyStr, overload
1922
from typing_extensions import LiteralString
@@ -60,6 +63,8 @@ __all__ = [
6063
]
6164
if sys.version_info >= (3, 12):
6265
__all__ += ["isjunction", "splitroot"]
66+
if sys.version_info >= (3, 13):
67+
__all__ += ["isdevdrive"]
6368

6469
supports_unicode_filenames: bool
6570
# aliases (also in os)

0 commit comments

Comments
 (0)