Brandt Bucher <brandtbuc...@gmail.com> added the comment:

> The rules for when things are comparable or not should be kept simple.

I think that the sort of user who uses complex numbers for their numerical 
calculations would still find this behavior "simple", but that may just be me.

> We don't want to have objects that are orderable depending on their values. I 
> can't think of anywhere else we do this.

Well... tuples and lists behave this way. ;)

> An application relying on this would be a nightmare to write comprehensive 
> tests for.

I'm not arguing that applications should rely on this behavior as core 
functionality, just that Python's more advanced math functionality deserves to 
be correct.

With that said, there are already so many weird limitations on complex numbers 
and floating-point values in general. I wouldn't expect users to treat 
comparing complex numbers any differently than they would treat comparing 
floats. Check check the .imag value in the former, check math.isnan in the 
latter.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36117>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to