[issue8748] integer-to-complex comparisons give incorrect results

Mark Dickinson report at bugs.python.org
Wed May 19 18:58:32 CEST 2010


Mark Dickinson <dickinsm at gmail.com> added the comment:

Okay, this patch looks fine to me for py3k.  More tests would be great, but I don't see much other cleaning up that needs doing.

Just one thing:  I'd make the 'i.imag == 0.0' check earlier, so that the potentially expensive long-to-float check can be avoided where appropriate.

I'd also move the 'op != Py_EQ && op != Py_NE' check before the first TO_COMPLEX, though I realize that this is orthogonal to the issue under discussion;  the definition seems cleaner that way, though I don't think it makes any difference to the behaviour.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8748>
_______________________________________


More information about the Python-bugs-list mailing list