Skip to content
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

Fix zero exponent for ints #7163

Merged
merged 4 commits into from
Feb 8, 2022
Merged

Conversation

Molkree
Copy link
Contributor

@Molkree Molkree commented Feb 8, 2022

It is typed as int instead of Any after this PR.

Followup to #6325 (comment)

It is typed as `int` instead of `Any` now
stdlib/builtins.pyi Outdated Show resolved Hide resolved
@github-actions

This comment has been minimized.

@AlexWaygood
Copy link
Member

Could you add the new overload to the pow definitions at lines 1349 and 1383, as well?

@github-actions

This comment has been minimized.

@Molkree
Copy link
Contributor Author

Molkree commented Feb 8, 2022

Could you add the new overload to the pow definitions at lines 1349 and 1383, as well?

Mhmmm, of course, missed those.

Overloads there require # type: ignore[misc] just like _PositiveInteger/_NegativeInteger overloads. Without it I'm getting errors like this:

Overloaded function signatures 3 and 10 overlap with incompatible return types

@AlexWaygood
Copy link
Member

AlexWaygood commented Feb 8, 2022

Overloads there require # type: ignore[misc] just like _PositiveInteger/_NegativeInteger overloads. Without it I'm getting errors like this:

Overloaded function signatures 3 and 10 overlap with incompatible return types

Yeah, mypy gets all panicky about this kind of thing, but infers the types just fine anyway ¯\_(ツ)_/¯

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

LGTM!

stdlib/builtins.pyi Outdated Show resolved Hide resolved
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2022

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

@hauntsaninja hauntsaninja merged commit be5a109 into python:master Feb 8, 2022
@Molkree Molkree deleted the zero-exponent branch February 9, 2022 18:07
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.

6 participants