Opened 7 years ago

Last modified 6 years ago

#19108 closed enhancement

Implement Python 3 style comparison in the coercion framework — at Initial Version

Reported by: ohanar Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: coercion Keywords:
Cc: jdemeyer Merged in:
Authors: R. Andrew Ohana Reviewers:
Report Upstream: N/A Work issues:
Branch: u/ohanar/python3stylecomparison (Commits, GitHub, GitLab) Commit: 168fafb347a6afbdc96cae5bc27a4bea1c22f2e9
Dependencies: Stopgaps:

Status badges

Description

Currently to implement comparison for an element, you either need to implement _cmp_ or _richcmp_. For developers accustom to Python 3's method of implementing each comparison operator, we should have _lt_, _le_, etc.

Additionally, for most elements where comparison makes sense, there is the overwhelming notion that such a comparison is a partial order. Thus (unlike in pure python) we should make the default behavior extend the provided operators to a partial order (provided enough comparison operators are provided).

Change History (0)

Note: See TracTickets for help on using tickets.