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

Meador Inge report at bugs.python.org
Fri May 21 18:18:30 CEST 2010


Meador Inge <meadori at gmail.com> added the comment:

> Hmm.  The current Python 2.7 behaviour really is a mess.

No doubt!

> Your patch removes the coercion entirely;  

Yeah, I know.  The funny thing about this is that according to the documentation [1]:

   "Arguments to rich comparison methods are never coerced."

> I'm not sure that's a good idea:  mightn't this change behaviour for 
> user-defined classes with a __coerce__ method?  Maybe it would be 
> better to just special-case ints and longs at the start of 
> complex_richcompare, and then leave everything else more-or-less 
> intact?

I will look into that today.

> I'm beginning to wonder whether it's actually worth fixing this at all > in 2.7.

:)

[1] http://docs.python.org/dev/reference/datamodel.html#basic-customization

----------

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


More information about the Python-bugs-list mailing list