Skip to content

Conversation

@hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Apr 12, 2023

Fixes #15024

Previously, the message inaccurately compared __call__ to __call__ instead of __new__ or __init__ for type objects

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

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

steam.py (https://github.com/Gobot1234/steam.py)
+ steam/ext/commands/converters.py:262: note:     Expected:
+ steam/ext/commands/converters.py:262: note:         def __call__(str, /) -> Any
+ steam/ext/commands/converters.py:262: note:     Got:
+ steam/ext/commands/converters.py:262: note:         def [T_co] __init__() -> Converter[T_co]

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Nice! This makes the error messages much clearer.

@JukkaL JukkaL merged commit 1a47b19 into python:master Apr 14, 2023
@hauntsaninja hauntsaninja deleted the proto-error branch April 14, 2023 19:30
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.

Callables and __init__ methods

2 participants