mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
change getattr stubs to better type the default argument and return type (#5516)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
@@ -1019,7 +1019,12 @@ class filter(Iterator[_T], Generic[_T]):
|
||||
def __next__(self) -> _T: ...
|
||||
|
||||
def format(__value: object, __format_spec: str = ...) -> str: ... # TODO unicode
|
||||
def getattr(__o: Any, name: str, __default: Any = ...) -> Any: ...
|
||||
@overload
|
||||
def getattr(__o: Any, name: str) -> Any: ...
|
||||
@overload
|
||||
def getattr(__o: Any, name: str, __default: None) -> Optional[Any]: ...
|
||||
@overload
|
||||
def getattr(__o: Any, name: str, __default: _T) -> Union[Any, _T]: ...
|
||||
def globals() -> Dict[str, Any]: ...
|
||||
def hasattr(__obj: Any, __name: str) -> bool: ...
|
||||
def hash(__obj: object) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user