Opened 8 years ago
Last modified 6 years ago
#17692 needs_work enhancement
The default __invert__ method of an element should avoid coercion — at Version 1
Reported by: | Stefan | Owned by: | |
---|---|---|---|
Priority: | trivial | Milestone: | sage-6.5 |
Component: | basic arithmetic | Keywords: | |
Cc: | vdelecroix | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
Currently, the __invert__
methods in element.pyx do
return 1/self
This results in a coercion of the integer 1 into the appropriate parent structure. Better would be to do
return self.parent().one_element() / self
Additionally, the __invert__
method in MultiplicativeGroupElement
relies on a method is_one()
that is not provided by the class itself.
Note: See
TracTickets for help on using
tickets.
cc'ing me (+ formatting in the description)