Message 336678 - Python tracker

Message336678

Author brandtbucher
Recipients brandtbucher, eric.smith, mark.dickinson, serhiy.storchaka
Date 2019-02-26.14:37:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551191875.92.0.675071391223.issue36117@roundup.psfhosted.org>
In-reply-to
Content
> 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.
History
Date User Action Args
2019-02-26 14:37:55brandtbuchersetrecipients: + brandtbucher, mark.dickinson, eric.smith, serhiy.storchaka
2019-02-26 14:37:55brandtbuchersetmessageid: <1551191875.92.0.675071391223.issue36117@roundup.psfhosted.org>
2019-02-26 14:37:55brandtbucherlinkissue36117 messages
2019-02-26 14:37:55brandtbuchercreate