Skip to content

Commit 240628c

Browse files
authored
Add missing objects to plistlib, and improve __all__ in asyncio.tasks, http.server, & multiprocessing.__init__ (#7363)
1 parent 070bbb4 commit 240628c

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

stdlib/asyncio/tasks.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ else:
4343
"wait_for",
4444
"as_completed",
4545
"sleep",
46-
"async",
4746
"gather",
4847
"shield",
4948
"ensure_future",

stdlib/http/server.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import sys
55
from _typeshed import StrPath, SupportsRead, SupportsWrite
66
from typing import Any, AnyStr, BinaryIO, ClassVar, Mapping, Sequence
77

8-
__all__ = ["HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"]
8+
if sys.version_info >= (3, 7):
9+
__all__ = ["HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"]
10+
else:
11+
__all__ = ["HTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"]
912

1013
class HTTPServer(socketserver.TCPServer):
1114
server_name: str

stdlib/multiprocessing/__init__.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ else:
102102
"get_logger",
103103
"get_start_method",
104104
"log_to_stderr",
105-
"parent_process",
106105
"reducer",
107106
"set_executable",
108107
"set_forkserver_preload",

stdlib/plistlib.pyi

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,20 @@ if sys.version_info < (3, 9):
105105
def writePlistToBytes(value: Mapping[str, Any]) -> bytes: ...
106106

107107
if sys.version_info < (3, 7):
108-
class Dict(dict[str, Any]):
108+
class _InternalDict(dict[str, Any]):
109109
def __getattr__(self, attr: str) -> Any: ...
110110
def __setattr__(self, attr: str, value: Any) -> None: ...
111111
def __delattr__(self, attr: str) -> None: ...
112112

113+
class Dict(_InternalDict): # deprecated
114+
def __init__(self, **kwargs: Any) -> None: ...
115+
116+
class Plist(_InternalDict): # deprecated
117+
def __init__(self, **kwargs: Any) -> None: ...
118+
@classmethod
119+
def fromFile(cls: type[Self], pathOrFile: str | IO[bytes]) -> Self: ...
120+
def write(self, pathOrFile: str | IO[bytes]) -> None: ...
121+
113122
if sys.version_info < (3, 9):
114123
class Data:
115124
data: bytes

tests/stubtest_allowlists/py36.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ ipaddress._BaseNetwork.__init__
3131
json.loads
3232
mmap.ACCESS_DEFAULT
3333
(os|posix).utime
34-
plistlib.Dict.__init__
3534
pyexpat.XMLParserType.ExternalEntityParserCreate # C signature is wrong - function gets only positional args
3635
random.Random.randrange # missing undocumented arg _int
3736
random.randrange # missing undocumented arg _int
@@ -121,7 +120,6 @@ html.parser.HTMLParser.unescape
121120
platform.popen
122121
plistlib.Data.asBase64
123122
plistlib.Data.fromBase64
124-
plistlib.Plist
125123
ssl.SSLObject.verify_client_post_handshake
126124
ssl.SSLSocket.verify_client_post_handshake
127125
sys.callstats

0 commit comments

Comments
 (0)