Dear Sage support,

as much as I know, I was raising a similar question before. But
actually I never got a successful solution for the following problem
(and "Search Sage Resources" didn't help either):

I have a Cython extension class that describes elements of some ring.
Thus, it should inherit from RingElement.

The following does not work:
  from sage.structure.element import RingElement
  cdef class MyClass(RingElement):

I was told that a Cython class can not inherit from a Python class,
so, I have to *c*import RingElement.

However, the cimport does not work:
  from sage.structure.element cimport RingElement
yields complaints that 'sage.structure.element.pxd' can't be found.

OK, probably I have to provide the appropriate include path. Robert
Bradshaw suggested off list to add SAGE_ROOT+"/devel/sage/" as include
directory.

But even when I added the *full* path to element.pxd into my setup.py
(option "include_dirs" of Extension), it did not work.

Very strange, since of course a lot of sage modules cimport
RingElements without problems.

So, in a nutshell: How can I cimport a Cython class from Sage (when I
am not in the devel tree, if that matters)? What include_dirs do I
need to provide?

Best regards,
    Simon



--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to