Changes between Version 31 and Version 32 of Ticket #20767


Ignore:
Timestamp:
08/04/16 06:18:20 (5 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #20767 – Description

    v31 v32  
    33The main consequence is that it matters a lot less whether a class inherits from `Element` or from `ModuleElement`/`RingElement`/`FieldElement`...
    44
    5 One difference remains: the more specialized classes have some default implementations for arithmetic. For example, `ModuleElement` implements unary negation as multiplication by -1. The base class `Element` has no such default implementations.
     5One difference between `Element` and more specialized classes like `RingElement` remains: the more specialized classes have some default implementations for arithmetic. For example, `ModuleElement` implements unary negation as multiplication by -1. The base class `Element` has no such default implementations.
    66
    77This patch also affects lookup in categories: with this patch, double-underscore methods like `__add__` are never taken from the category. The `Element` classes take precedence over the category, so the default implementations of arithmetic operations will override whatever is in the category (this is existing behaviour, not affected by this patch). For the base class `Element`, this is not an issue since there are no default implementations.