[sage-support] how does one do this in Cython?

2011-07-24 Thread john_perry_usm
I want to declare c to be of the type defined by the class Rational. I'm sure this is easy, but what I want to do is this: from sage.rings.rational import Rational cdef Rational c but that doesn't work. Neither does cimport (which I found in a file somewhere, albeit commented out, and

Re: [sage-support] how does one do this in Cython?

2011-07-24 Thread William Stein
On Sun, Jul 24, 2011 at 5:47 PM, john_perry_usm john.pe...@usm.edu wrote: I want to declare c to be of the type defined by the class Rational. I'm sure this is easy, but what I want to do is this: from sage.rings.rational import Rational cdef Rational c but that doesn't work. Neither

Re: [sage-support] how does one do this in Cython?

2011-07-24 Thread William Stein
On Sunday, July 24, 2011, john_perry_usm john.pe...@usm.edu wrote: What about not-the-notebook? :-) For example, I have the following file, called test_rational.pyx: from sage.rings.rational import Rational import --- cimport ?! cpdef Rational add(a, b): return a + b When I