Skip to content

Commit

Permalink
builtins: add an overload for getattr with None default
Browse files Browse the repository at this point in the history
This found a couple issues in mypy (see
python/mypy#9889)
  • Loading branch information
hauntsaninja committed Jan 7, 2021
1 parent 8cad322 commit a7adb87
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stdlib/3/builtins.pyi
Expand Up @@ -966,6 +966,9 @@ def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> Iterator[_T]
@overload
def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> Iterator[_T]: ...
def format(__value: object, __format_spec: str = ...) -> str: ... # TODO unicode
@overload
def getattr(__o: Any, name: str, __default: None) -> Optional[Any]: ...
@overload
def getattr(__o: Any, name: str, __default: Any = ...) -> Any: ...
def globals() -> Dict[str, Any]: ...
def hasattr(__obj: Any, __name: str) -> bool: ...
Expand Down

0 comments on commit a7adb87

Please sign in to comment.