Skip to content

Commit 8292678

Browse files
stdlib: add a few more defaults (python#14618)
Co-authored-by: Alex Waygood <[email protected]>
1 parent f32d9f0 commit 8292678

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

stdlib/configparser.pyi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,13 @@ class ParsingError(Error):
449449
def __init__(self, source: str) -> None: ...
450450
else:
451451
@overload
452-
def __init__(self, source: str, filename: None = None) -> None: ...
452+
def __init__(self, source: str) -> None: ...
453+
@overload
454+
@deprecated("The `filename` parameter removed in Python 3.12. Use `source` instead.")
455+
def __init__(self, source: None, filename: str | None) -> None: ...
453456
@overload
454457
@deprecated("The `filename` parameter removed in Python 3.12. Use `source` instead.")
455-
def __init__(self, source: None = None, filename: str = ...) -> None: ...
458+
def __init__(self, source: None = None, *, filename: str | None) -> None: ...
456459

457460
def append(self, lineno: int, line: str) -> None: ...
458461

stdlib/lib2to3/fixes/fix_tuple_params.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from _typeshed import Incomplete
21
from typing import ClassVar, Literal
32

43
from .. import fixer_base
@@ -13,5 +12,5 @@ class FixTupleParams(fixer_base.BaseFix):
1312

1413
def simplify_args(node): ...
1514
def find_params(node): ...
16-
def map_to_index(param_list, prefix=..., d: Incomplete | None = ...): ...
15+
def map_to_index(param_list, prefix=[], d=None): ...
1716
def tuple_name(param_list): ...

stdlib/os/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ if sys.platform != "win32":
11971197

11981198
def getcwd() -> str: ...
11991199
def getcwdb() -> bytes: ...
1200-
def chmod(path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, follow_symlinks: bool = ...) -> None: ...
1200+
def chmod(path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, follow_symlinks: bool = True) -> None: ...
12011201

12021202
if sys.platform != "win32" and sys.platform != "linux":
12031203
def chflags(path: StrOrBytesPath, flags: int, follow_symlinks: bool = True) -> None: ... # some flavors of Unix

0 commit comments

Comments
 (0)