Skip to content

[mypyc] Use method_sig to get the method signature#21567

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

[mypyc] Use method_sig to get the method signature#21567
rheard wants to merge 1 commit into
python:masterfrom
rheard:fix-21566

Conversation

@rheard
Copy link
Copy Markdown

@rheard rheard commented May 30, 2026

Fixes #21566

create_ne_from_eq() checks whether the class has an __eq__ method using cls.has_method("__eq__"), but gen_glue_ne_method() then requires cls.get_method("__eq__") to return a concrete FuncIR.

In this package-cycle case, the inherited method declaration exists, but the concrete FuncIR body is not available yet. This makes cls.has_method("__eq__") true while cls.get_method("__eq__") returns None.

@rheard rheard changed the title Use method_sig to get the method signature [mypyc] Use method_sig to get the method signature May 30, 2026
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 assertion error when generating __ne__ from inherited __eq__ in package import cycle

1 participant