[sage-support] Re: [Cython] Howto import pure c function versions of sagemath functions into cython

2016-05-08 Thread Nils Bruin
On Sunday, May 8, 2016 at 1:10:44 PM UTC-7, Max Külshammer wrote: > > Thanks for answering! I was in holiday. Now I tested: > > %cython > > from sage.rings.integer cimport Integer > > cpdef int W(): > cdef Integer x = 5 > cdef Integer y = 2 > if x._is_power_of(y) == True: > pr

[sage-support] Re: [Cython] Howto import pure c function versions of sagemath functions into cython

2016-05-08 Thread Max Külshammer
Thanks for answering! I was in holiday. Now I tested: %cython from sage.rings.integer cimport Integer cpdef int W(): cdef Integer x = 5 cdef Integer y = 2 if x._is_power_of(y) == True: print 'yes' return 1 But got the error: Exception TypeError: 'Cannot convert int to s