#19108: Implement Python 3 style comparison in the coercion framework
-------------------------------------+-------------------------------------
       Reporter:  ohanar             |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.9
      Component:  coercion           |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  R. Andrew Ohana    |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/ohanar/python3stylecomparison    |  168fafb347a6afbdc96cae5bc27a4bea1c22f2e9
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by ohanar):

 * status:  needs_review => needs_work


Old 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).

New 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.

--

Comment:

 Yes, you are right.

 Thinking about it a bit more, I think it would make better sense to split
 off the partial/total order stuff into metaclasses, I'll split those into
 another ticket when I get around it.

--
Ticket URL: <http://trac.sagemath.org/ticket/19108#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to