8000 More precise overloads for get/pop methods by eltoder · Pull Request #10501 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

More precise overloads for get/pop methods #10501

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 6 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
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
Revert changes to Shelf and Context
These trigger false positives in stubtest.
  • Loading branch information
eltoder committed Jul 22, 2023
commit ba31e478ef51d609f514bc95f5fe2d443d746db1
2 changes: 0 additions & 2 deletions stdlib/contextvars.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ class Context(Mapping[ContextVar[Any], Any]):
@overload
def get(self, __key: ContextVar[_T]) -> _T | None: ...
@overload
def get(self, __key: ContextVar[_T], __default: _T) -> _T: ...
@overload
def get(self, __key: ContextVar[_T], __default: _D) -> _T | _D: ...
def run(self, callable: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ...
def copy(self) -> Context: ...
Expand Down
2 changes: 0 additions & 2 deletions stdlib/shelve.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ class Shelf(MutableMapping[str, _VT]):
@overload
def get(self, key: str) -> _VT | None: ...
@overload
def get(self, key: str, default: _VT) -> _VT: ...
@overload
def get(self, key: str, default: _T) -> _VT | _T: ...
def __getitem__(self, key: str) -> _VT: ...
def __setitem__(self, key: str, value: _VT) -> None: ...
Expand Down
0