8000 stdlib: fix signatures for some functions with unrepresentable defaul… · python/typeshed@d9311f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit d9311f9

Browse files
stdlib: fix signatures for some functions with unrepresentable defaults (#11000)
Found with python/mypy#16433 Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
1 parent 7f9b3ea commit d9311f9

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

stdlib/_locale.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22
from _typeshed import StrPath
3-
from collections.abc import Iterable, Mapping
3+
from collections.abc import Mapping
44

55
LC_CTYPE: int
66
LC_COLLATE: int
@@ -10,7 +10,7 @@ LC_NUMERIC: int
1010
LC_ALL: int
1111
CHAR_MAX: int
1212

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

1616
if sys.version_info >= (3, 11):

stdlib/builtins.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ if sys.version_info >= (3, 10):
12881288
# 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
12891289
def anext(__i: _SupportsSynchronousAnext[_AwaitableT]) -> _AwaitableT: ...
12901290
@overload
1291-
async def anext(__i: SupportsAnext[_T], default: _VT) -> _T | _VT: ...
1291+
async def anext(__i: SupportsAnext[_T], __default: _VT) -> _T | _VT: ...
12921292

12931293
# compile() returns a CodeType, unless the flags argument includes PyCF_ONLY_AST (=1024),
12941294
# in which case it returns ast.AST. We have overloads for flag 0 (the default) and for

stdlib/cmath.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def exp(__z: _C) -> complex: ...
3030
def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = 1e-09, abs_tol: SupportsFloat = 0.0) -> bool: ...
3131
def isinf(__z: _C) -> bool: ...
3232
def isnan(__z: _C) -> bool: ...
33-
def log(__x: _C, __y_obj: _C = ...) -> complex: ...
33+
def log(__x: _C, __base: _C = ...) -> complex: ...
3434
def log10(__z: _C) -> complex: ...
3535
def phase(__z: _C) -> float: ...
3636
def polar(__z: _C) -> tuple[float, float]: ...

stdlib/locale.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ from _locale import (
88
LC_NUMERIC as LC_NUMERIC,
99
LC_TIME as LC_TIME,
1010
localeconv as localeconv,
11-
setlocale as setlocale,
1211
strcoll as strcoll,
1312
strxfrm as strxfrm,
1413
)
1514

1615
# This module defines a function "str()", which is why "str" can't be used
1716
# as a type annotation or type alias.
1817
from builtins import str as _str
19-
from collections.abc import Callable
18+
from collections.abc import Callable, Iterable
2019
from decimal import Decimal
2120
from typing import Any
2221

@@ -131,6 +130,7 @@ def getdefaultlocale(
131130
envvars: tuple[_str, ...] = ("LC_ALL", "LC_CTYPE", "LANG", "LANGUAGE")
132131
) -> tuple[_str | None, _str | None]: ...
133132
def getlocale(category: int = ...) -> tuple[_str | None, _str | None]: ...
133+
def setlocale(category: int, locale: _str | Iterable[_str | None] | None = None) -> _str: ...
134134
def getpreferredencoding(do_setlocale: bool = True) -> _str: ...
135135
def normalize(localename: _str) -> _str: ...
136136
def resetlocale(category: int = ...) -> None: ...

stdlib/os/__init__.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -970,9 +970,9 @@ else:
970970
def WTERMSIG(status: int) -> int: ...
971971
if sys.version_info >= (3, 8):
972972
def posix_spawn(
973-
path: StrOrBytesPath,
974-
argv: _ExecVArgs,
975-
env: _ExecEnv,
973+
__path: StrOrBytesPath,
974+
__argv: _ExecVArgs,
975+
__env: _ExecEnv,
976976
*,
977977
file_actions: Sequence[tuple[Any, ...]] | None = ...,
978978
setpgroup: int | None = ...,
@@ -983,9 +983,9 @@ else:
983983
scheduler: tuple[Any, sched_param] | None = ...,
984984
) -> int: ...
985985
def posix_spawnp(
986-
path: StrOrBytesPath,
987-
argv: _ExecVArgs,
988-
env: _ExecEnv,
986+
__path: StrOrBytesPath,
987+
__argv: _ExecVArgs,
988+
__env: _ExecEnv,
989989
*,
990990
file_actions: Sequence[tuple[Any, ...]] | None = ...,
991991
setpgroup: int | None = ...,

stdlib/sqlite3/dbapi2.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ class Connection:
352352
def cursor(self, cursorClass: None = None) -> Cursor: ...
353353
@overload
354354
def cursor(self, cursorClass: Callable[[Connection], _CursorT]) -> _CursorT: ...
355-
def execute(self, sql: str, parameters: _Parameters = ...) -> Cursor: ...
355+
def execute(self, __sql: str, __parameters: _Parameters = ...) -> Cursor: ...
356356
def executemany(self, __sql: str, __parameters: Iterable[_Parameters]) -> Cursor: ...
357357
def executescript(self, __sql_script: str) -> Cursor: ...
358358
def interrupt(self) -> None: ...

0 commit comments

Comments
 (0)
0