mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Make getattr() parameters positional-only (#6235)
This commit is contained in:
@@ -1041,16 +1041,16 @@ class filter(Iterator[_T], Generic[_T]):
|
||||
|
||||
def format(__value: object, __format_spec: str = ...) -> str: ... # TODO unicode
|
||||
@overload
|
||||
def getattr(__o: object, name: str) -> Any: ...
|
||||
def getattr(__o: object, __name: str) -> Any: ...
|
||||
|
||||
# While technically covered by the last overload, spelling out the types for None and bool
|
||||
# help mypy out in some tricky situations involving type context (aka bidirectional inference)
|
||||
@overload
|
||||
def getattr(__o: object, name: str, __default: None) -> Any | None: ...
|
||||
def getattr(__o: object, __name: str, __default: None) -> Any | None: ...
|
||||
@overload
|
||||
def getattr(__o: object, name: str, __default: bool) -> Any | bool: ...
|
||||
def getattr(__o: object, __name: str, __default: bool) -> Any | bool: ...
|
||||
@overload
|
||||
def getattr(__o: object, name: str, __default: _T) -> Any | _T: ...
|
||||
def getattr(__o: object, __name: str, __default: _T) -> Any | _T: ...
|
||||
def globals() -> dict[str, Any]: ...
|
||||
def hasattr(__obj: object, __name: str) -> bool: ...
|
||||
def hash(__obj: object) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user