Skip to content
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

Process superclass methods before subclass methods in semanal #18723

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ilevkivskyi
Copy link
Member

Fixes #7162

See also discussion in #18674 for another situation when this causes problems (deferrals). In general this problem is probably quite rare, but it bugs me, so I decided to go ahead with a simple and explicit (even though a bit ugly) solution.

@ilevkivskyi
Copy link
Member Author

Hm, for some reason tests didn't start, I will try closing and re-opening.

@ilevkivskyi ilevkivskyi reopened this Feb 22, 2025
Copy link
Contributor

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

django-stubs (https://github.com/typeddjango/django-stubs)

freqtrade (https://github.com/freqtrade/freqtrade)

@ilevkivskyi
Copy link
Member Author

Oh well, it looks like this PR causes mypyc compiled mypy to segfault when running some tests.

@ilevkivskyi
Copy link
Member Author

And as I guessed the error happens in one of those Bogus things, more precisely in CPyDef_semanal___SemanticAnalyzer___qualified_name (in PyUnicode_Concat one of the args is NULL or something).

@ilevkivskyi
Copy link
Member Author

Actually it is much more tricky than that, fullname etc. are no longer Bogus instead empty strings are used. Looking at gdb, it seems that two totally valid strings are passed to PyUnicode_Concat but it segfaults. Maybe something is wrong with refcounting? I will try to dig a bit more with Python debug build.

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.

Processing order of methods affects inferred attribute types
1 participant