Cython: undeclared name not builtin
Loading a .spyx file with
def bla(W):
RootSystem(W.cartan_type())
yields
undeclared name not builtin: RootSystem
Is there a library that I need to include?
It looks like you should:
sage: import_statements(RootSystem)
from sage.combinat.root_system.root_system import RootSystem
As you can see in the documentation of import_statements, it tries to find out from where the symbol requested should be imported and returns a string that describes a command to do that import. So, in your case, it suggests to use
from sage.combinat.root_system.root_system import RootSystem
If you check the contents of sage.all, you'll see that it consists entirely of imports from other modules. There is something to say for importing symbols from their original location, which is why import_statements traces the import to its actual origin. I wouldn't say the import from sage.all is wrong but it's definitely not the right answer.
Asked: 2020-01-03 17:32:28 +0100
Seen: 4,254 times
Last updated: Jan 04 '20
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.