Changes between Initial Version and Version 1 of Ticket #27584, comment 36


Ignore:
Timestamp:
04/08/19 15:30:26 (2 years ago)
Author:
egourgoulhon
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27584, comment 36

    initial v1  
    77> In the present case, both for scalar field and mixed form algebras, we are dealing with a base ring that is commutative (since it is a field), so shouldn't we have only `_rmul_`?
    88
    9 I see in line 2394 of `src/sage/structure/element.pyx` that `_rmul_` falls back to `_lmul_`, which is not implemented at the `ModuleElement` level (actually returns `None`). This leaves the impression that when implementing a new module element class over a commutative ring, one shall actually implement `_lmul_` and not `_rmul_`... 
     9I see in line 2394 of `src/sage/structure/element.pyx` that `_rmul_` falls back to `_lmul_`, which is not implemented at the `ModuleElement` level (actually returns `None`). This leaves the impression that when implementing a new module element class over a commutative ring, one shall actually implement `_lmul_` and not `_rmul_`...  Accordingly, my understanding at the moment is that in Sage, we have
     10- `_mul_(self, other)` when `self` and `other` have the same parent
     11- `_lmul_(self, other)` when `self` and `other` have distinct parents
     12- `_rmul_(self, other)` is inherited from  `ModuleElement` (if not redefined) and falls back to `_lmul_`
     13
     14Travis, do you confirm?