[issue36117] Allow rich comparisons for real-valued complex objects.

Eric V. Smith report at bugs.python.org
Tue Feb 26 05:24:03 EST 2019


Eric V. Smith <eric at trueblade.com> added the comment:

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

It would be very easy to have a complex == 42+0.0000001j, after some calculation. This near-zero imaginary part would prevent it from being orderable, while if a similar calculation produced exactly 42+0j, then that instance would be orderable. An application relying on this would be a nightmare to write comprehensive tests for.

Whether something is orderable or not should depend solely on its type, not its value.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36117>
_______________________________________


More information about the Python-bugs-list mailing list