Skip to content

Commit fbc092b

Browse files
authored
Stdlib: add defaults for several functions that delegate kwargs to other functions at runtime (#9791)
1 parent 6ac1518 commit fbc092b

7 files changed

Lines changed: 1394 additions & 1370 deletions

File tree

stdlib/asyncio/subprocess.pyi

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,24 @@ if sys.version_info >= (3, 11):
5454
bufsize: Literal[0] = 0,
5555
encoding: None = None,
5656
errors: None = None,
57-
text: Literal[False, None] = ...,
57+
text: Literal[False, None] = None,
5858
# These parameters are taken by subprocess.Popen, which this ultimately delegates to
59-
executable: StrOrBytesPath | None = ...,
60-
preexec_fn: Callable[[], Any] | None = ...,
61-
close_fds: bool = ...,
62-
cwd: StrOrBytesPath | None = ...,
63-
env: subprocess._ENV | None = ...,
64-
startupinfo: Any | None = ...,
65-
creationflags: int = ...,
66-
restore_signals: bool = ...,
67-
start_new_session: bool = ...,
59+
executable: StrOrBytesPath | None = None,
60+
preexec_fn: Callable[[], Any] | None = None,
61+
close_fds: bool = True,
62+
cwd: StrOrBytesPath | None = None,
63+
env: subprocess._ENV | None = None,
64+
startupinfo: Any | None = None,
65+
creationflags: int = 0,
66+
restore_signals: bool = True,
67+
start_new_session: bool = False,
6868
pass_fds: Collection[int] = ...,
69-
group: None | str | int = ...,
70-
extra_groups: None | Collection[str | int] = ...,
71-
user: None | str | int = ...,
72-
umask: int = ...,
73-
process_group: int | None = ...,
74-
pipesize: int = ...,
69+
group: None | str | int = None,
70+
extra_groups: None | Collection[str | int] = None,
71+
user: None | str | int = None,
72+
umask: int = -1,
73+
process_group: int | None = None,
74+
pipesize: int = -1,
7575
) -> Process: ...
7676
async def create_subprocess_exec(
7777
program: _ExecArg,
@@ -87,23 +87,23 @@ if sys.version_info >= (3, 11):
8787
encoding: None = None,
8888
errors: None = None,
8989
# These parameters are taken by subprocess.Popen, which this ultimately delegates to
90-
text: bool | None = ...,
91-
executable: StrOrBytesPath | None = ...,
92-
preexec_fn: Callable[[], Any] | None = ...,
93-
close_fds: bool = ...,
94-
cwd: StrOrBytesPath | None = ...,
95-
env: subprocess._ENV | None = ...,
96-
startupinfo: Any | None = ...,
97-
creationflags: int = ...,
98-
restore_signals: bool = ...,
99-
start_new_session: bool = ...,
90+
text: bool | None = None,
91+
executable: StrOrBytesPath | None = None,
92+
preexec_fn: Callable[[], Any] | None = None,
93+
close_fds: bool = True,
94+
cwd: StrOrBytesPath | None = None,
95+
env: subprocess._ENV | None = None,
96+
startupinfo: Any | None = None,
97+
creationflags: int = 0,
98+
restore_signals: bool = True,
99+
start_new_session: bool = False,
100100
pass_fds: Collection[int] = ...,
101-
group: None | str | int = ...,
102-
extra_groups: None | Collection[str | int] = ...,
103-
user: None | str | int = ...,
104-
umask: int = ...,
105-
process_group: int | None = ...,
106-
pipesize: int = ...,
101+
group: None | str | int = None,
102+
extra_groups: None | Collection[str | int] = None,
103+
user: None | str | int = None,
104+
umask: int = -1,
105+
process_group: int | None = None,
106+
pipesize: int = -1,
107107
) -> Process: ...
108108

109109
elif sys.version_info >= (3, 10):
@@ -120,23 +120,23 @@ elif sys.version_info >= (3, 10):
120120
bufsize: Literal[0] = 0,
121121
encoding: None = None,
122122
errors: None = None,
123-
text: Literal[False, None] = ...,
123+
text: Literal[False, None] = None,
124124
# These parameters are taken by subprocess.Popen, which this ultimately delegates to
125-
executable: StrOrBytesPath | None = ...,
126-
preexec_fn: Callable[[], Any] | None = ...,
127-
close_fds: bool = ...,
128-
cwd: StrOrBytesPath | None = ...,
129-
env: subprocess._ENV | None = ...,
130-
startupinfo: Any | None = ...,
131-
creationflags: int = ...,
132-
restore_signals: bool = ...,
133-
start_new_session: bool = ...,
125+
executable: StrOrBytesPath | None = None,
126+
preexec_fn: Callable[[], Any] | None = None,
127+
close_fds: bool = True,
128+
cwd: StrOrBytesPath | None = None,
129+
env: subprocess._ENV | None = None,
130+
startupinfo: Any | None = None,
131+
creationflags: int = 0,
132+
restore_signals: bool = True,
133+
start_new_session: bool = False,
134134
pass_fds: Collection[int] = ...,
135-
group: None | str | int = ...,
136-
extra_groups: None | Collection[str | int] = ...,
137-
user: None | str | int = ...,
138-
umask: int = ...,
139-
pipesize: int = ...,
135+
group: None | str | int = None,
136+
extra_groups: None | Collection[str | int] = None,
137+
user: None | str | int = None,
138+
umask: int = -1,
139+
pipesize: int = -1,
140140
) -> Process: ...
141141
async def create_subprocess_exec(
142142
program: _ExecArg,
@@ -152,22 +152,22 @@ elif sys.version_info >= (3, 10):
152152
encoding: None = None,
153153
errors: None = None,
154154
# These parameters are taken by subprocess.Popen, which this ultimately delegates to
155-
text: bool | None = ...,
156-
executable: StrOrBytesPath | None = ...,
157-
preexec_fn: Callable[[], Any] | None = ...,
158-
close_fds: bool = ...,
159-
cwd: StrOrBytesPath | None = ...,
160-
env: subprocess._ENV | None = ...,
161-
startupinfo: Any | None = ...,
162-
creationflags: int = ...,
163-
restore_signals: bool = ...,
164-
start_new_session: bool = ...,
155+
text: bool | None = None,
156+
executable: StrOrBytesPath | None = None,
157+
preexec_fn: Callable[[], Any] | None = None,
158+
close_fds: bool = True,
159+
cwd: StrOrBytesPath | None = None,
160+
env: subprocess._ENV | None = None,
161+
startupinfo: Any | None = None,
162+
creationflags: int = 0,
163+
restore_signals: bool = True,
164+
start_new_session: bool = False,
165165
pass_fds: Collection[int] = ...,
166-
group: None | str | int = ...,
167-
extra_groups: None | Collection[str | int] = ...,
168-
user: None | str | int = ...,
169-
umask: int = ...,
170-
pipesize: int = ...,
166+
group: None | str | int = None,
167+
extra_groups: None | Collection[str | int] = None,
168+
user: None | str | int = None,
169+
umask: int = -1,
170+
pipesize: int = -1,
171171
) -> Process: ...
172172

173173
else: # >= 3.9
@@ -185,22 +185,22 @@ else: # >= 3.9
185185
bufsize: Literal[0] = 0,
186186
encoding: None = None,
187187
errors: None = None,
188-
text: Literal[False, None] = ...,
188+
text: Literal[False, None] = None,
189189
# These parameters are taken by subprocess.Popen, which this ultimately delegates to
190-
executable: StrOrBytesPath | None = ...,
191-
preexec_fn: Callable[[], Any] | None = ...,
192-
close_fds: bool = ...,
193-
cwd: StrOrBytesPath | None = ...,
194-
env: subprocess._ENV | None = ...,
195-
startupinfo: Any | None = ...,
196-
creationflags: int = ...,
197-
restore_signals: bool = ...,
198-
start_new_session: bool = ...,
190+
executable: StrOrBytesPath | None = None,
191+
preexec_fn: Callable[[], Any] | None = None,
192+
close_fds: bool = True,
193+
cwd: StrOrBytesPath | None = None,
194+
env: subprocess._ENV | None = None,
195+
startupinfo: Any | None = None,
196+
creationflags: int = 0,
197+
restore_signals: bool = True,
198+
start_new_session: bool = False,
199199
pass_fds: Collection[int] = ...,
200-
group: None | str | int = ...,
201-
extra_groups: None | Collection[str | int] = ...,
202-
user: None | str | int = ...,
203-
umask: int = ...,
200+
group: None | str | int = None,
201+
extra_groups: None | Collection[str | int] = None,
202+
user: None | str | int = None,
203+
umask: int = -1,
204204
) -> Process: ...
205205
async def create_subprocess_exec(
206206
program: _ExecArg,
@@ -217,19 +217,19 @@ else: # >= 3.9
217217
encoding: None = None,
218218
errors: None = None,
219219
# These parameters are taken by subprocess.Popen, which this ultimately delegates to
220-
text: bool | None = ...,
221-
executable: StrOrBytesPath | None = ...,
222-
preexec_fn: Callable[[], Any] | None = ...,
223-
close_fds: bool = ...,
224-
cwd: StrOrBytesPath | None = ...,
225-
env: subprocess._ENV | None = ...,
226-
startupinfo: Any | None = ...,
227-
creationflags: int = ...,
228-
restore_signals: bool = ...,
229-
start_new_session: bool = ...,
220+
text: bool | None = None,
221+
executable: StrOrBytesPath | None = None,
222+
preexec_fn: Callable[[], Any] | None = None,
223+
close_fds: bool = True,
224+
cwd: StrOrBytesPath | None = None,
225+
env: subprocess._ENV | None = None,
226+
startupinfo: Any | None = None,
227+
creationflags: int = 0,
228+
restore_signals: bool = True,
229+
start_new_session: bool = False,
230230
pass_fds: Collection[int] = ...,
231-
group: None | str | int = ...,
232-
extra_groups: None | Collection[str | int] = ...,
233-
user: None | str | int = ...,
234-
umask: int = ...,
231+
group: None | str | int = None,
232+
extra_groups: None | Collection[str | int] = None,
233+
user: None | str | int = None,
234+
umask: int = -1,
235235
) -> Process: ...

stdlib/distutils/dist.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class Distribution:
9090
have_run: Incomplete
9191
want_user_cfg: bool
9292
def dump_option_dicts(
93-
self, header: Incomplete | None = ..., commands: Incomplete | None = ..., indent: str = ...
93+
self, header: Incomplete | None = None, commands: Incomplete | None = None, indent: str = ""
9494
) -> None: ...
9595
def find_config_files(self): ...
9696
commands: Incomplete
@@ -102,8 +102,8 @@ class Distribution:
102102
def get_command_list(self): ...
103103
def get_command_packages(self): ...
104104
def get_command_class(self, command): ...
105-
def reinitialize_command(self, command, reinit_subcommands: int = ...): ...
106-
def announce(self, msg, level=...) -> None: ...
105+
def reinitialize_command(self, command, reinit_subcommands: int = 0): ...
106+
def announce(self, msg, level=2) -> None: ...
107107
def run_commands(self) -> None: ...
108108
def run_command(self, command) -> None: ...
109109
def has_pure_modules(self): ...

0 commit comments

Comments
 (0)