8000 Make Mapping.get(default) more constrained by ndmitchell · Pull Request #14360 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Make Mapping.get(default) more constrained #14360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jul 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update types.pyi
  • Loading branch information
ndmitchell authored Jul 1, 2025
commit 3be1d26f648589e970f89491fedc977b105972d8
4 changes: 3 additions & 1 deletion stdlib/types.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ class MappingProxyType(Mapping[_KT, _VT_co]):
@overload
def get(self, key: _KT, /) -> _VT_co | None: ...
@overload
def get(self, key: _KT, default: _VT_co | _T2, /) -> _VT_co | _T2: ...
def get(self, key: _KT, default: _VT_co, /) -> _VT_co: ...
@overload
def get(self, key: _KT, default: _T2, /) -> _T2: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def __reversed__(self) -> Iterator[_KT]: ...
def __or__(self, value: Mapping[_T1, _T2], /) -> dict[_KT | _T1, _VT_co | _T2]: ...
Expand Down
0