Skip to content

Commit

Permalink
stdlib: fix signatures for some functions with unrepresentable defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Nov 9, 2023
1 parent 7f9b3ea commit a1ecb3c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion stdlib/_locale.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LC_NUMERIC: int
LC_ALL: int
CHAR_MAX: int

def setlocale(category: int, locale: str | Iterable[str | None] | None = None) -> str: ...
def setlocale(__category: int, __locale: str | Iterable[str | None] | None = None) -> str: ...
def localeconv() -> Mapping[str, int | str | list[int]]: ...

if sys.version_info >= (3, 11):
Expand Down
2 changes: 1 addition & 1 deletion stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ if sys.version_info >= (3, 10):
# See discussion in #7491 and pure-Python implementation of `anext` at https://github.com/python/cpython/blob/ea786a882b9ed4261eafabad6011bc7ef3b5bf94/Lib/test/test_asyncgen.py#L52-L80
def anext(__i: _SupportsSynchronousAnext[_AwaitableT]) -> _AwaitableT: ...
@overload
async def anext(__i: SupportsAnext[_T], default: _VT) -> _T | _VT: ...
async def anext(__i: SupportsAnext[_T], __default: _VT) -> _T | _VT: ...

# compile() returns a CodeType, unless the flags argument includes PyCF_ONLY_AST (=1024),
# in which case it returns ast.AST. We have overloads for flag 0 (the default) and for
Expand Down
2 changes: 1 addition & 1 deletion stdlib/cmath.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def exp(__z: _C) -> complex: ...
def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = 1e-09, abs_tol: SupportsFloat = 0.0) -> bool: ...
def isinf(__z: _C) -> bool: ...
def isnan(__z: _C) -> bool: ...
def log(__x: _C, __y_obj: _C = ...) -> complex: ...
def log(__x: _C, __base: _C = ...) -> complex: ...
def log10(__z: _C) -> complex: ...
def phase(__z: _C) -> float: ...
def polar(__z: _C) -> tuple[float, float]: ...
Expand Down
12 changes: 6 additions & 6 deletions stdlib/os/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -970,9 +970,9 @@ else:
def WTERMSIG(status: int) -> int: ...
if sys.version_info >= (3, 8):
def posix_spawn(
path: StrOrBytesPath,
argv: _ExecVArgs,
env: _ExecEnv,
__path: StrOrBytesPath,
__argv: _ExecVArgs,
__env: _ExecEnv,
*,
file_actions: Sequence[tuple[Any, ...]] | None = ...,
setpgroup: int | None = ...,
Expand All @@ -983,9 +983,9 @@ else:
scheduler: tuple[Any, sched_param] | None = ...,
) -> int: ...
def posix_spawnp(
path: StrOrBytesPath,
argv: _ExecVArgs,
env: _ExecEnv,
__path: StrOrBytesPath,
__argv: _ExecVArgs,
__env: _ExecEnv,
*,
file_actions: Sequence[tuple[Any, ...]] | None = ...,
setpgroup: int | None = ...,
Expand Down
2 changes: 1 addition & 1 deletion stdlib/sqlite3/dbapi2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ class Connection:
def cursor(self, cursorClass: None = None) -> Cursor: ...
@overload
def cursor(self, cursorClass: Callable[[Connection], _CursorT]) -> _CursorT: ...
def execute(self, sql: str, parameters: _Parameters = ...) -> Cursor: ...
def execute(self, __sql: str, __parameters: _Parameters = ...) -> Cursor: ...
def executemany(self, __sql: str, __parameters: Iterable[_Parameters]) -> Cursor: ...
def executescript(self, __sql_script: str) -> Cursor: ...
def interrupt(self) -> None: ...
Expand Down

0 comments on commit a1ecb3c

Please sign in to comment.