Opened 8 years ago

Last modified 6 years ago

#17692 needs_work enhancement

The default __invert__ method of an element should avoid coercion — at Initial Version

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:

Status badges

Description

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.

Change History (0)

Note: See TracTickets for help on using tickets.