Skip to content

Remove _(rich)cmp_c_impl #17890

@jdemeyer

Description

@jdemeyer

Instead of

    def _cmp_(left, right)
    cdef int _cmp_c_impl(left, right) except -2

we should have

    cpdef int _cmp_(left, right) except -2

Analogously for _richcmp_.

There is one important functional change: If a Python class defines both __cmp__ and _cmp_, then formerly the coercion framework would use __cmp__ by default to implement relational operators like >=. After this ticket, _cmp_ will be tried first, which defaults to __cmp__.

CC: @dkrenn

Component: cython

Author: Jeroen Demeyer

Branch/Commit: 3976f2c

Reviewer: Vincent Delecroix

Issue created by migration from https://trac.sagemath.org/ticket/17890

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions