mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-11 19:00:52 +08:00
Make Mapping.get(default) more constrained (#14360)
This commit is contained in:
+3
-1
@@ -745,7 +745,9 @@ class Mapping(Collection[_KT], Generic[_KT, _VT_co]):
|
||||
@overload
|
||||
def get(self, key: _KT, /) -> _VT_co | None: ...
|
||||
@overload
|
||||
def get(self, key: _KT, /, default: _VT_co | _T) -> _VT_co | _T: ...
|
||||
def get(self, key: _KT, /, default: _VT_co) -> _VT_co: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] # Covariant type as parameter
|
||||
@overload
|
||||
def get(self, key: _KT, /, default: _T) -> _VT_co | _T: ...
|
||||
def items(self) -> ItemsView[_KT, _VT_co]: ...
|
||||
def keys(self) -> KeysView[_KT]: ...
|
||||
def values(self) -> ValuesView[_VT_co]: ...
|
||||
|
||||
Reference in New Issue
Block a user