Skip to content

Add explanation if argument type is incompatible because of a "numbers" type#15137

Merged
hauntsaninja merged 5 commits intomasterfrom
numbers-note
Apr 26, 2023
Merged

Add explanation if argument type is incompatible because of a "numbers" type#15137
hauntsaninja merged 5 commits intomasterfrom
numbers-note

Conversation

@JukkaL
Copy link
Copy Markdown
Collaborator

@JukkaL JukkaL commented Apr 25, 2023

Types from numbers aren't really supported in any useful way. Make it more explicit, since this is surprising.

Work on #3186.

@JukkaL JukkaL changed the title Add explanation if argument type is incompatible because of type from "numbers" Add explanation if argument type is incompatible because a "numbers" type Apr 25, 2023
@JukkaL JukkaL changed the title Add explanation if argument type is incompatible because a "numbers" type Add explanation if argument type is incompatible because of a "numbers" type Apr 25, 2023
Copy link
Copy Markdown
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.

Brilliant that we're improving usability here!

Comment thread mypy/messages.py Outdated
Comment thread mypy/messages.py
@github-actions

This comment has been minimized.

JukkaL and others added 3 commits April 25, 2023 17:19
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Copy link
Copy Markdown
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.

yay!

@github-actions
Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

spack (https://github.com/spack/spack) got 1.10 slower (67.7s -> 74.6s)

Copy link
Copy Markdown
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

This looks great, thank you!

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