How to use cython functions from other cython cells in notbook?
Hi, I'm currently using sage with the notebook interface. How can I define a function in a cython cell and use it in another cython cell?
I understand I need to import the first cython module but the name changes after every evaluation.
Also being able to do this directly from notebook (without writing a separate cython file) and from separate cells would be handy.
For example this works fine:
cell1:
%cython
def test(int n):
return 2*n
cell 2:
def test2(m):
return test(m)
cell 3:
test2(3)
5
but this does not:
cell 4:
%cython
def test3(int m):
return test(m)
pyx:7:15: undeclared name not builtin: test
Thank you :)