#19497: Improve comparison framework
-------------------------------------+-------------------------------------
Reporter: jdemeyer | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.10
Component: cython | Resolution:
Keywords: | Merged in:
Authors: Jeroen Demeyer | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jdemeyer/improve_comparison_framework|
2497282901353b174fc8d290be0532c3874d4952
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by jdemeyer):
Replying to [comment:7 vdelecroix]:
> These are not equivalent
> {{{
> - elif PyInt_CheckExact(right):
> + elif isinstance(right, int):
> }}}
> As far as I understand, `PyInt_Check` is equivalent to `isinstance(.,
int)` and `PyInt_CheckExact` is equivalent to `type(.) is int`. Why did
you change them in this ticket?
First of all, it's cleaner to write pure Python code than using Python
C/API calls (and in this case, it's equally fast). The reason I chose
`isinstance(...)` instead of `type(...) is ...` is simply because the
former is usually the right thing to do. In Python, checking equality of
types is not normally done.
If you want to give positive_review to this ticket modulo this change,
I'll happily change it back.
--
Ticket URL: <http://trac.sagemath.org/ticket/19497#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.