Skip to content

Commit 591593c

Browse files
authored
Simplify __all__ for modules beginning with 'm' to 't' (#8028)
1 parent b88ea4a commit 591593c

File tree

15 files changed

+614
-1620
lines changed

15 files changed

+614
-1620
lines changed

stdlib/multiprocessing/__init__.pyi

Lines changed: 40 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -29,85 +29,47 @@ if sys.version_info >= (3, 8):
2929
if sys.platform != "win32":
3030
from multiprocessing.context import ForkContext, ForkServerContext
3131

32+
__all__ = [
33+
"Array",
34+
"AuthenticationError",
35+
"Barrier",
36+
"BoundedSemaphore",
37+
"BufferTooShort",
38+
"Condition",
39+
"Event",
40+
"JoinableQueue",
41+
"Lock",
42+
"Manager",
43+
"Pipe",
44+
"Pool",
45+
"Process",
46+
"ProcessError",
47+
"Queue",
48+
"RLock",
49+
"RawArray",
50+
"RawValue",
51+
"Semaphore",
52+
"SimpleQueue",
53+
"TimeoutError",
54+
"Value",
55+
"active_children",
56+
"allow_connection_pickling",
57+
"cpu_count",
58+
"current_process",
59+
"freeze_support",
60+
"get_all_start_methods",
61+
"get_context",
62+
"get_logger",
63+
"get_start_method",
64+
"log_to_stderr",
65+
"reducer",
66+
"set_executable",
67+
"set_forkserver_preload",
68+
"set_start_method",
69+
]
70+
3271
if sys.version_info >= (3, 8):
33-
__all__ = [
34-
"Array",
35-
"AuthenticationError",
36-
"Barrier",
37-
"BoundedSemaphore",
38-
"BufferTooShort",
39-
"Condition",
40-
"Event",
41-
"JoinableQueue",
42-
"Lock",
43-
"Manager",
44-
"Pipe",
45-
"Pool",
46-
"Process",
47-
"ProcessError",
48-
"Queue",
49-
"RLock",
50-
"RawArray",
51-
"RawValue",
52-
"Semaphore",
53-
"SimpleQueue",
54-
"TimeoutError",
55-
"Value",
56-
"active_children",
57-
"allow_connection_pickling",
58-
"cpu_count",
59-
"current_process",
60-
"freeze_support",
61-
"get_all_start_methods",
62-
"get_context",
63-
"get_logger",
64-
"get_start_method",
65-
"parent_process",
66-
"log_to_stderr",
67-
"reducer",
68-
"set_executable",
69-
"set_forkserver_preload",
70-
"set_start_method",
71-
]
72-
else:
73-
__all__ = [
74-
"Array",
75-
"AuthenticationError",
76-
"Barrier",
77-
"BoundedSemaphore",
78-
"BufferTooShort",
79-
"Condition",
80-
"Event",
81-
"JoinableQueue",
82-
"Lock",
83-
"Manager",
84-
"Pipe",
85-
"Pool",
86-
"Process",
87-
"ProcessError",
88-
"Queue",
89-
"RLock",
90-
"RawArray",
91-
"RawValue",
92-
"Semaphore",
93-
"SimpleQueue",
94-
"TimeoutError",
95-
"Value",
96-
"active_children",
97-
"allow_connection_pickling",
98-
"cpu_count",
99-
"current_process",
100-
"freeze_support",
101-
"get_all_start_methods",
102-
"get_context",
103-
"get_logger",
104-
"get_start_method",
105-
"log_to_stderr",
106-
"reducer",
107-
"set_executable",
108-
"set_forkserver_preload",
109-
"set_start_method",
110-
]
72+
__all__ += ["parent_process"]
11173

11274
# The following type aliases can be used to annotate the return values of
11375
# the corresponding functions. They are not defined at runtime.

stdlib/ntpath.pyi

Lines changed: 43 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -45,89 +45,49 @@ from posixpath import (
4545
from typing import AnyStr, overload
4646
from typing_extensions import LiteralString
4747

48-
if sys.version_info >= (3, 7) or sys.platform != "win32":
49-
__all__ = [
50-
"normcase",
51-
"isabs",
52-
"join",
53-
"splitdrive",
54-
"split",
55-
"splitext",
56-
"basename",
57-
"dirname",
58-
"commonprefix",
59-
"getsize",
60-
"getmtime",
61-
"getatime",
62-
"getctime",
63-
"islink",
64-
"exists",
65-
"lexists",
66-
"isdir",
67-
"isfile",
68-
"ismount",
69-
"expanduser",
70-
"expandvars",
71-
"normpath",
72-
"abspath",
73-
"curdir",
74-
"pardir",
75-
"sep",
76-
"pathsep",
77-
"defpath",
78-
"altsep",
79-
"extsep",
80-
"devnull",
81-
"realpath",
82-
"supports_unicode_filenames",
83-
"relpath",
84-
"samefile",
85-
"sameopenfile",
86-
"samestat",
87-
"commonpath",
88-
]
89-
else:
90-
__all__ = [
91-
"normcase",
92-
"isabs",
93-
"join",
94-
"splitdrive",
95-
"split",
96-
"splitext",
97-
"basename",
98-
"dirname",
99-
"commonprefix",
100-
"getsize",
101-
"getmtime",
102-
"getatime",
103-
"getctime",
104-
"islink",
105-
"exists",
106-
"lexists",
107-
"isdir",
108-
"isfile",
109-
"ismount",
110-
"expanduser",
111-
"expandvars",
112-
"normpath",
113-
"abspath",
114-
"splitunc",
115-
"curdir",
116-
"pardir",
117-
"sep",
118-
"pathsep",
119-
"defpath",
120-
"altsep",
121-
"extsep",
122-
"devnull",
123-
"realpath",
124-
"supports_unicode_filenames",
125-
"relpath",
126-
"samefile",
127-
"sameopenfile",
128-
"samestat",
129-
"commonpath",
130-
]
48+
__all__ = [
49+
"normcase",
50+
"isabs",
51+
"join",
52+
"splitdrive",
53+
"split",
54+
"splitext",
55+
"basename",
56+
"dirname",
57+
"commonprefix",
58+
"getsize",
59+
"getmtime",
60+
"getatime",
61+
"getctime",
62+
"islink",
63+
"exists",
64+
"lexists",
65+
"isdir",
66+
"isfile",
67+
"ismount",
68+
"expanduser",
69+
"expandvars",
70+
"normpath",
71+
"abspath",
72+
"curdir",
73+
"pardir",
74+
"sep",
75+
"pathsep",
76+
"defpath",
77+
"altsep",
78+
"extsep",
79+
"devnull",
80+
"realpath",
81+
"supports_unicode_filenames",
82+
"relpath",
83+
"samefile",
84+
"sameopenfile",
85+
"samestat",
86+
"commonpath",
87+
]
88+
89+
if sys.version_info < (3, 7) and sys.platform == "win32":
90+
__all__ += ["splitunc"]
13191

13292
def splitunc(p: AnyStr) -> tuple[AnyStr, AnyStr]: ... # deprecated
13393

0 commit comments

Comments
 (0)