Skip to content

Fix zero exponent for ints - #7163

Merged
hauntsaninja merged 4 commits into
python:masterfrom
Molkree:zero-exponent
Feb 8, 2022
Merged

hauntsaninja merged 4 commits into
python:masterfrom
Molkree:zero-exponent

Conversation

@Molkree

@Molkree Molkree commented Feb 8, 2022 •

Copy link
Copy Markdown
Contributor

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

Followup to #6325 (comment)

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

This comment has been minimized.

@AlexWaygood

Copy link
Copy Markdown
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

Molkree commented Feb 8, 2022

Copy link
Copy Markdown
Contributor Author

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

AlexWaygood commented Feb 8, 2022 •

Copy link
Copy Markdown
Member

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 ¯\_(ツ)_/¯

@AlexWaygood AlexWaygood left a comment

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.

LGTM!

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

This comment has been minimized.

1 similar comment
@github-actions

github-actions Bot commented Feb 8, 2022

Copy link
Copy Markdown
Contributor

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