Skip to content

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

Merged
p-sawicki merged 1 commit into
python:masterfrom
rheard:fix-21566
Jun 1, 2026
Merged

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

Conversation

@rheard
Copy link
Copy Markdown
Contributor

@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
Copy link
Copy Markdown
Collaborator

@p-sawicki p-sawicki left a comment

Choose a reason for hiding this comment

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

looks good, thank you!

@p-sawicki p-sawicki merged commit 70b74e1 into python:master Jun 1, 2026
18 checks passed
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

2 participants