-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[BUG] binding=True causes a mysterious import error #4775
Comments
To me this looks like a circular import issue possible? From the sage issue:
With Therefore I provisionally don't think it's a Cython bug - it looks a lot like code that wouldn't work in Python either |
I think if you remove the line
it'll work. You don't look to actually use the cimport so you're losing nothing by removing it. However I can't work out how the code is working at all with or without binding. At least on a simplified test locally it makes no difference if it's enabled for not. |
Right. There was a circular import. We could fix the problem by changing the global imports to local imports. Your explanation below confirms that we did the right thing.
So |
Possibly... I tried to make a cut-down example to replicate it myself and couldn't make it work with either version! Anyway - hopefully you have enough information to fix it... I'll close this issue I think |
This issue arose while we tried to turn on
binding=True
cython compiler option in SageMath 9.6.rc3:https://trac.sagemath.org/ticket/26254#comment:64
The function
call_registered_function()
is defined in the filesrc/sage/symbolic/pynac_function_impl.pxi
, which is included intosrc/sage/symbolic/expression.pyx
byinclude "pynac_function_impl.pxi"
.Then the statement
from .expression import call_registered_function
in the global scope ofsrc/sage/symbolic/function.pyx
throws the exceptionImportError: cannot import name call_registered_function
This may be a bug on cython since we don't have this exception with the default
binding=False
.SageMath 9.6.rc3 uses python-3.10.3 and cython-0.29.28.
The text was updated successfully, but these errors were encountered: