mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-16 19:11:26 +08:00
Make Mapping.get(default) more constrained (#14360)
This commit is contained in:
1 parent
75d8c88ec5
commit
dbd3ad356e
12 files changed
+39
-8
No files matched your search
+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