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 some more duplicate enum to_py utility code names #5905
Fix some more duplicate enum to_py utility code names #5905
Conversation
It's possible to declare an extern enum multiple times, in a way that makes the declaration name the same. Therefore, also prefix declaration names with the module qualified name where possible.
I'm fairly sure this does fix #5860 |
Yes, it does fix the compilation. Thanks!
|
That's definitely intentional. The change behind most of this is that when you do something like
it now returns an instance of the enum class rather than just an What it's recommending you do is create a |
it'll allow the enum wrapper class to be importable.
That might also solve the original problem why the OP resorted to a mix of include+import.
|
But I already have a file, named enums.pyx, that is a symbolic link to libibverbs_enums.pxd and from python code the user imports from enums.pyx and it works fine. Shouldn't this behavior be kept in Cython 3? The same goes for other warnings like libibverbs.pxd. Eventually, the user doesn't directly import from "libibverbs.pyx" but for multiple .pyx files, which themselves cimports from libibverbs.pxd... It's either I'm missing something or the new warnings are an unwanted consequence of an underlying behavioral change in Cython. |
Cython/Compiler/PyrexTypes.py
Outdated
if scope_name: | ||
safe = "%s_%s" % (scope_name, safe) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like this should use scope mangling rather than simple concatenation.
Probably just the distraction by the unrelated discussion above. I left a comment. |
Will this fix be part of 3.0.9 or 3.1? |
* Fix some more duplicate enum to_py utility code names It's possible to declare an extern enum multiple times, in a way that makes the declaration name the same. Therefore, also prefix declaration names with the module qualified name where possible. * Use scope mangling
3.0.x commit 0185350 |
It's possible to declare an extern enum multiple times, in a way that makes the declaration name the same. Therefore, also prefix declaration names with the module qualified name where possible.