-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Bind self to the class being defined when checking multiple inheritance #18465
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
Merged
ilevkivskyi
merged 1 commit into
python:master
from
sterliakov:bugfix/st-map-self-in-inherited-methods
Jan 14, 2025
Merged
Bind self to the class being defined when checking multiple inheritance #18465
ilevkivskyi
merged 1 commit into
python:master
from
sterliakov:bugfix/st-map-self-in-inherited-methods
Jan 14, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ab8a8c3
to
e715672
Compare
Diff from mypy_primer, showing the effect of this PR on open source code: pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/common.py:956: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/arrays/datetimes.py:174: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/arrays/_mixins.py:93: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/arrays/numpy_.py:48: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/arrays/datetimelike.py:199: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/arrays/categorical.py:247: error: Unused "type: ignore" comment [unused-ignore]
ibis (https://github.com/ibis-project/ibis)
- ibis/expr/operations/core.py:21: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/core.py:43: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/relations.py:36: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:32: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:41: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:54: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:67: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:79: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:90: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:101: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:120: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:138: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:156: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:184: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:197: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:233: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:254: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:279: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:290: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:301: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:310: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:319: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:328: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:338: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:348: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:359: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:373: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:395: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/reductions.py:404: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/generic.py:180: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/vectorized.py:36: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/vectorized.py:44: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/operations/geospatial.py:186: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/expr/rewrites.py:29: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/common/tests/test_graph_benchmarks.py:15: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/common/tests/test_graph.py:204: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/common/tests/test_graph.py:246: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/common/tests/test_egraph.py:123: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/common/tests/test_egraph.py:158: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/common/tests/test_egraph.py:175: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/common/tests/test_egraph.py:191: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/common/tests/test_egraph.py:195: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
- ibis/common/tests/test_egraph.py:211: error: Definition of "__recreate__" in base class "Annotable" is incompatible with definition in base class "Node" [misc]
|
Hm, looks great - all removed errors are essentially equivalent to the snippet in #18458. |
ilevkivskyi
approved these changes
Jan 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think this makes sense.
This was referenced Jan 15, 2025
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #18458.
When checking base class compatibility, the class being defined is not yet in scope. However, it should be equivalent to the class passed to
bind_and_map_method
with free typevars, as that's exactly what we are currently defining.