From 82926783a4a00d41cb49fa602d6fb735ed0d2d2c Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 21 Aug 2025 13:13:06 -0700 Subject: [PATCH] stdlib: add a few more defaults (#14618) Co-authored-by: Alex Waygood --- stdlib/configparser.pyi | 7 +++++-- stdlib/lib2to3/fixes/fix_tuple_params.pyi | 3 +-- stdlib/os/__init__.pyi | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/stdlib/configparser.pyi b/stdlib/configparser.pyi index b3a421003..764a8a965 100644 --- a/stdlib/configparser.pyi +++ b/stdlib/configparser.pyi @@ -449,10 +449,13 @@ class ParsingError(Error): def __init__(self, source: str) -> None: ... else: @overload - def __init__(self, source: str, filename: None = None) -> None: ... + def __init__(self, source: str) -> None: ... @overload @deprecated("The `filename` parameter removed in Python 3.12. Use `source` instead.") - def __init__(self, source: None = None, filename: str = ...) -> None: ... + def __init__(self, source: None, filename: str | None) -> None: ... + @overload + @deprecated("The `filename` parameter removed in Python 3.12. Use `source` instead.") + def __init__(self, source: None = None, *, filename: str | None) -> None: ... def append(self, lineno: int, line: str) -> None: ... diff --git a/stdlib/lib2to3/fixes/fix_tuple_params.pyi b/stdlib/lib2to3/fixes/fix_tuple_params.pyi index bfaa9970c..7f4f7f4e8 100644 --- a/stdlib/lib2to3/fixes/fix_tuple_params.pyi +++ b/stdlib/lib2to3/fixes/fix_tuple_params.pyi @@ -1,4 +1,3 @@ -from _typeshed import Incomplete from typing import ClassVar, Literal from .. import fixer_base @@ -13,5 +12,5 @@ class FixTupleParams(fixer_base.BaseFix): def simplify_args(node): ... def find_params(node): ... -def map_to_index(param_list, prefix=..., d: Incomplete | None = ...): ... +def map_to_index(param_list, prefix=[], d=None): ... def tuple_name(param_list): ... diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index f003a2e42..71c79dfac 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -1197,7 +1197,7 @@ if sys.platform != "win32": def getcwd() -> str: ... def getcwdb() -> bytes: ... -def chmod(path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, follow_symlinks: bool = ...) -> None: ... +def chmod(path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, follow_symlinks: bool = True) -> None: ... if sys.platform != "win32" and sys.platform != "linux": def chflags(path: StrOrBytesPath, flags: int, follow_symlinks: bool = True) -> None: ... # some flavors of Unix