On Mar 7, 2009, at 12:10 AM, Simon King wrote: > Hi! > > I would like to create an extension class that inherits from > CommutativeRingElement. In order to learn how it works, I looked at > the file sage/rings/polynomial/multi_polynomial.pyx and ...pxd > > However, the whole story fails at a *very* basic level: Just for > testing, I copied both files multi_polynomial.pyx and > multi_polynomial.pxd into some directory, and in this directory I said > sage: attach multi_polynomial.pyx > > It failed in the line > cdef class MPolynomial(CommutativeRingElement): > with the message > 'CommutativeRingElement' is not declared > > Why? > > Is 'attach' the wrong thing to do if there is a .pxd file around?
Note that you only need a .pxd file for other stuff to inherit from you. Also, attach works with ".spyx" files (basically .pyx files, I'm not sure why we have that distinction). - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
