Re: Call cython functions from other cython cells?

2 views
Skip to first unread message

William Stein

unread,
May 15, 2011, 8:54:00 PM5/15/11
to Michael Snider, 480uw11
On Sun, May 15, 2011 at 3:44 PM, Michael Snider <snid...@gmail.com> wrote:
> Hello Professor Stein,
>
> I'm sorry if I missed this, but is there a way to call a  cdef cython
> function that was defined in an earlier cell in the notebook in a later
> %cython cell?

No, that is not possible. You have to write a normal def function in
the same %cython block, and call that instead... or put everything in
one block.


- William

>
> Such as:
>
> First Cell:
> %cython
> cdef test():
>     #stuff
>
> Second Cell:
> %cython
> def test2():
>     test()
>
> Thanks,
>
> Michael Snider
>

--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

Reply all
Reply to author
Forward
0 new messages