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
Fix an issue trying list.index indexing in FusedNode #5896
Fix an issue trying list.index indexing in FusedNode #5896
Conversation
In some Python versions, generating the error message when .index fails to find an index leads to a compiler crash. Fix this by not relying on type being fully set up while generating __str__. Fixes cython#5894 and cython#5588
This fixes the symptom, but it seems worth investigating where we use this. Maybe we don't actually need to call the function to display the type there? Maybe we can do something else instead? Swallowing errors always risks hiding other errors, that was the reason for the change in CPython as well.
|
cython/Cython/Compiler/FusedNode.py Lines 199 to 204 in 02ddde3
We find the index of an entry in a list. If the index isn't found then Python calls It could probably be rewritten to do an |
Yes, that seems better. |
In some Python versions, generating the error message when .index fails to find an index leads to a compiler crash.
Fix this by not relying on type being fully set up while generating
__repr__
.Fixes #5894 and #5588