Hi Simon, >From my perspective, the only potential issue is speed. Even a Python > function returning the constant "True" is quite slow. But I think, if > speed matters, it should be possible to have a separate Cython module > providing a class, say, > sage.categories.element_methods.FieldElementMethods, > and then assign Fields.ElementMethods = FieldElementMethods. In that way, > elements of rings would inherit a method is_unit that probably is faster > what we currently have. >
We already have FieldElement, which is a Cython class consisting of methods, including is_unit(). Ignoring my opinion about C.ElementMethods for a moment, why not just move the existing methods in FieldsElementMethods to FieldElement and then set Fields.ElementMethods = FieldElement, and similarly for other Element classes? (With or without static inheritance between the Cython classes, whichever makes it work.) Peter -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.