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?
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.
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2020-01-03 17:32:28 +0100
Seen: 4,251 times
Last updated: Jan 04 '20
Short Cython Example In A Notebook Cell?
HowTo Compute Past Largest Cython Supported Wordsize (efficiently)?
How to enable %cython magic function in sage terminal mode?
using %cython in Cantor with sage backend
Does Cython support type names from inttypes.h?
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.