Skip to content

Use other arg instead of self for RHS type#21569

Open
rheard wants to merge 1 commit into
python:masterfrom
rheard:fix-21568
Open

Use other arg instead of self for RHS type#21569
rheard wants to merge 1 commit into
python:masterfrom
rheard:fix-21568

Conversation

@rheard
Copy link
Copy Markdown

@rheard rheard commented May 30, 2026

Fixes #21568

In gen_glue_ne_method, mypyc currently chooses the generated RHS argument type like this when strict dunder typing is enabled:

rhs_type = eq_sig.args[0].type if strict_typing else object_rprimitive

However, the __eq__ signature includes self, so eq_sig.args[0] is the type of self, not the type of other.

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.

mypyc generated __ne__ uses self type instead of __eq__'s RHS type with strict dunder typing

1 participant