FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix stubtest complaints for various `.get()` methods by AlexWaygood · Pull Request #10690 · python/typeshed · GitHub

Repository navigation

Fix stubtest complaints for various .get() methods - #10690

Merged
JelleZijlstra merged 8 commits into
python:mainfrom
AlexWaygood:dot-get
Sep 10, 2023
Merged

JelleZijlstra merged 8 commits into
python:mainfrom
AlexWaygood:dot-get

Conversation

AlexWaygood commented Sep 10, 2023 •
edited
Loading

Copy link
Copy Markdown
Member

key and default can be passed as keyword arguments for all of these methods

AlexWaygood marked this pull request as draft September 10, 2023 15:39

This comment has been minimized.

AlexWaygood changed the title Fix stubtest complaints for collections.ChainMap.get() and collections.UserDict.get() Fix stubtest complaints for various .get() methods Sep 10, 2023

This comment has been minimized.

AlexWaygood commented Sep 10, 2023 •
edited
Loading

Copy link
Copy Markdown
Member Author

Looks like a lot of the dict.get()-related errors in #10690 (comment) are actually "desirable" to some extent; mypy seems to be flagging a lot of issues in user code there. But the proposed changes to dict.get() were disruptive enough that they deserve to be considered in their own PR, so I've backed them out for now.

This comment has been minimized.

AlexWaygood marked this pull request as ready for review September 10, 2023 16:29
Comment thread stdlib/collections/__init__.pyi Outdated
Comment thread stdlib/weakref.pyi Outdated
AlexWaygood marked this pull request as draft September 10, 2023 20:25

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

AlexWaygood marked this pull request as ready for review September 10, 2023 20:39

Copy link
Copy Markdown
Member Author

Thanks for the great review @Daverball!

def __ior__(self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ...
@overload
def __ior__(self, other: Iterable[tuple[_KT, _VT]]) -> Self: ...
if sys.version_info >= (3, 12):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I guess this is from python/cpython#17910

JelleZijlstra merged commit 6dda2fe into python:main Sep 10, 2023
AlexWaygood deleted the dot-get branch September 10, 2023 21:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL