Skip to content

Use conditional overloads to simplify several stdlib functions#7540

Merged
srittau merged 5 commits into
python:masterfrom
AlexWaygood:overloads
Mar 25, 2022
Merged

Use conditional overloads to simplify several stdlib functions#7540
srittau merged 5 commits into
python:masterfrom
AlexWaygood:overloads

Conversation

@AlexWaygood

Copy link
Copy Markdown
Member

This feature is now supported by pyright and, as of version 0.940, mypy (python/mypy#10712). Not sure whether pytype supports it or not, but wanted to see what the CI thought about it.

@AlexWaygood AlexWaygood marked this pull request as ready for review March 23, 2022 21:18
@github-actions

Copy link
Copy Markdown
Contributor

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

@AlexWaygood

AlexWaygood commented Mar 24, 2022

Copy link
Copy Markdown
Member Author

@rchen152, does pytype support this feature? (No rush to do so, if not — it's more of a "nice to have" than a "need to have" :)

@rchen152

Copy link
Copy Markdown
Collaborator

Yeah, this should work with pytype! (I played around with the example in python/mypy#10712, and pytype's parsing output looks fine.)

@AlexWaygood

Copy link
Copy Markdown
Member Author

Yeah, this should work with pytype! (I played around with the example in python/mypy#10712, and pytype's parsing output looks fine.)

Awesome!

@srittau srittau merged commit b63c963 into python:master Mar 25, 2022
@AlexWaygood AlexWaygood deleted the overloads branch March 25, 2022 08:33
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