On Tue, Nov 23, 2010 at 11:30 AM, David Roe <r...@math.harvard.edu> wrote: > >> Yep. Since this is such a common case, I wonder if we should modify >> the Sage integer __richcmp__ method to be more sophisticated, and >> allow direct comparisons with builtin Python types, without first >> requiring them to be converted to Sage integers? > > That's such a good idea that I did it. > http://trac.sagemath.org/sage_trac/ticket/10314, ready for review.
See my review. I found a major bug, and have a little idea for an easy speedup. This is a great example of the review process in action, by the way. > > BEFORE: > sage: a = 3 > sage: b = 4r > sage: timeit("a < b") > 625 loops, best of 3: 1.34 µs per loop > > AFTER: > sage: a = 3 > sage: b = 4r > sage: timeit("a < b") > 625 loops, best of 3: 147 ns per loop > > David > > -- > To post to this group, send an email to sage-devel@googlegroups.com > To unsubscribe from this group, send an email to > sage-devel+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-devel > URL: http://www.sagemath.org > -- William Stein Professor of Mathematics University of Washington http://wstein.org -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org