stdlib: Fix more signatures with unrepresentable defaults (#11007)

This commit is contained in:
Jelle Zijlstra
2023-11-09 18:20:09 -08:00
committed by GitHub
parent b8932899ea
commit 4deef7550f
6 changed files with 48 additions and 25 deletions

View File

@@ -1434,9 +1434,9 @@ def getattr(__o: object, __name: str, __default: None) -> Any | None: ...
@overload
def getattr(__o: object, __name: str, __default: bool) -> Any | bool: ...
@overload
def getattr(__o: object, name: str, __default: list[Any]) -> Any | list[Any]: ...
def getattr(__o: object, __name: str, __default: list[Any]) -> Any | list[Any]: ...
@overload
def getattr(__o: object, name: str, __default: dict[Any, Any]) -> Any | dict[Any, Any]: ...
def getattr(__o: object, __name: str, __default: dict[Any, Any]) -> Any | dict[Any, Any]: ...
@overload
def getattr(__o: object, __name: str, __default: _T) -> Any | _T: ...
def globals() -> dict[str, Any]: ...
@@ -1451,13 +1451,13 @@ class _GetItemIterable(Protocol[_T_co]):
def __getitem__(self, __i: int) -> _T_co: ...
@overload
def iter(__iterable: SupportsIter[_SupportsNextT]) -> _SupportsNextT: ...
def iter(__object: SupportsIter[_SupportsNextT]) -> _SupportsNextT: ...
@overload
def iter(__iterable: _GetItemIterable[_T]) -> Iterator[_T]: ...
def iter(__object: _GetItemIterable[_T]) -> Iterator[_T]: ...
@overload
def iter(__function: Callable[[], _T | None], __sentinel: None) -> Iterator[_T]: ...
def iter(__object: Callable[[], _T | None], __sentinel: None) -> Iterator[_T]: ...
@overload
def iter(__function: Callable[[], _T], __sentinel: object) -> Iterator[_T]: ...
def iter(__object: Callable[[], _T], __sentinel: object) -> Iterator[_T]: ...
# Keep this alias in sync with unittest.case._ClassInfo
if sys.version_info >= (3, 10):