Hello Simon,

* Simon King <simon.k...@uni-jena.de> [2013-09-14 19:59:38 +0000]:
> On 2013-09-14, Peter Bruin <pjbr...@gmail.com> wrote:
> > - Do the methods coming from ElementMethods always take priority over
> > (override) those from the base classes?
> 
> No, it is the other way around.

True, and anything else would be extremely confusing. However, this is
the actual problem with Fields.ElementMethods.is_unit(): RingElement
defines is_unit(), so if an element inherits from RingElement it will
never use that method. Clearly, in the case of residue fields we can
change them to inherit from FieldElement but more generally, would it
not make sense to move RingElement.is_unit() to
Rings.ElementMethods.is_unit()? Since any RingElement's parent will be
in the category of Rings anyway the ring elements will still have their
is_unit() but if it turns out that we are in a field, then they get a
better is_unit(). Or is there a scenario where the parent of a
RingElement is not in Rings()?

julian

Attachment: pgpHISt4hQVqk.pgp
Description: PGP signature

Reply via email to