Skip to content

Commit 1945090

Browse files
committed
more srittau feedback
1 parent dec5871 commit 1945090

3 files changed

Lines changed: 17 additions & 35 deletions

File tree

stdlib/genericpath.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ if sys.version_info >= (3, 13):
2525
__all__ += ["isjunction", "isdevdrive", "lexists"]
2626
if sys.version_info >= (3, 15):
2727
__all__ += ["ALL_BUT_LAST"]
28-
ALL_BUT_LAST: object
2928

3029
# All overloads can return empty string. Ideally, Literal[""] would be a valid
3130
# Iterable[T], so that list[T] | Literal[""] could be used as a return
@@ -94,3 +93,7 @@ if sys.version_info >= (3, 13):
9493
# Added in Python 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4
9594
_AllowMissingType = NewType("_AllowMissingType", object)
9695
ALLOW_MISSING: _AllowMissingType
96+
97+
if sys.version_info >= (3, 15):
98+
_AllButLastType = NewType("_AllButLastType", object)
99+
ALL_BUT_LAST: _AllButLastType

stdlib/http/server.pyi

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,11 @@ from ssl import Purpose, SSLContext
1010
from typing import Any, AnyStr, BinaryIO, ClassVar, Protocol, type_check_only
1111
from typing_extensions import Self, deprecated
1212

13-
if sys.version_info >= (3, 15):
14-
__all__ = [
15-
"HTTPServer",
16-
"ThreadingHTTPServer",
17-
"HTTPSServer",
18-
"ThreadingHTTPSServer",
19-
"BaseHTTPRequestHandler",
20-
"SimpleHTTPRequestHandler",
21-
]
22-
elif sys.version_info >= (3, 14):
23-
__all__ = [
24-
"HTTPServer",
25-
"ThreadingHTTPServer",
26-
"HTTPSServer",
27-
"ThreadingHTTPSServer",
28-
"BaseHTTPRequestHandler",
29-
"SimpleHTTPRequestHandler",
30-
"CGIHTTPRequestHandler",
31-
]
32-
else:
33-
__all__ = ["HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"]
13+
__all__ = ["HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler"]
14+
if sys.version_info < (3, 15):
15+
__all__ += ["CGIHTTPRequestHandler"]
16+
if sys.version_info >= (3, 14):
17+
__all__ = ["HTTPSServer", "ThreadingHTTPSServer"]
3418

3519
class HTTPServer(socketserver.TCPServer):
3620
server_name: str

stdlib/ntpath.pyi

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -114,24 +114,19 @@ def join(path: StrPath, /, *paths: StrPath) -> str: ...
114114
@overload
115115
def join(path: BytesPath, /, *paths: BytesPath) -> bytes: ...
116116

117-
if sys.platform == "win32":
118-
if sys.version_info >= (3, 15):
119-
@overload
120-
def realpath(path: PathLike[AnyStr], /, *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
121-
@overload
122-
def realpath(path: AnyStr, /, *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
123-
else:
117+
if sys.version_info >= (3, 15):
118+
@overload
119+
def realpath(path: PathLike[AnyStr], /, *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
120+
@overload
121+
def realpath(path: AnyStr, /, *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
122+
123+
else:
124+
if sys.platform == "win32":
124125
@overload
125126
def realpath(path: PathLike[AnyStr], *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
126127
@overload
127128
def realpath(path: AnyStr, *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
128129

129-
else:
130-
if sys.version_info >= (3, 15):
131-
@overload
132-
def realpath(path: PathLike[AnyStr], /, *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
133-
@overload
134-
def realpath(path: AnyStr, /, *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
135130
else:
136131
realpath = abspath
137132

0 commit comments

Comments
 (0)