#17890: Remove _(rich)cmp_c_impl
-------------------------------------+-------------------------------------
Reporter: jdemeyer | Owner:
Type: enhancement | Status: needs_info
Priority: major | Milestone: sage-6.6
Component: cython | Resolution:
Keywords: | Merged in:
Authors: Jeroen Demeyer | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jdemeyer/ticket/17890 | 313a400146b0fb19d80c31117d44ce735041d4ec
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by jdemeyer):
Replying to [comment:51 vdelecroix]:
> 9. implementation of `_(rich)cmp`:
> - Why in `_(rich)cmp` it starts with the case `not
have_same_parent_c(left,right)` instead of
`have_same_parent_c(left,right)`. It would make it more readable the other
way around.
I don't know why it would be more readable, but I can change it.
> - In `return left._(rich)cmp_(<Element>right, op)` is the `<Element>`
really needed or usefull?
It's useful for efficiency. Note how `_(rich)cmp_` is declared with
`Element right`. By explicitly calling this with `<Element>right`, Cython
does not need to check that `right` is indeed an `Element`.
> - could `_left, _right = coercion_model.canonical_coercion(left,
right)` be replaced with `left, right =
coercion_model.canonical_coercion(left, right)`. As far as I see, there is
no need of these extra variables.
Perhaps surprisingly, there is a need at least for an extra variable
`_left`. The point is that `left` is a "self" argument which Cython will
always assume and require that it is an instance of `Element`.
--
Ticket URL: <http://trac.sagemath.org/ticket/17890#comment:52>
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.