This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients corona10, ethan smith, gvanrossum, gyu-don, mark.dickinson, serhiy.storchaka, terry.reedy
Date 2021-08-23.10:05:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629713109.9.0.0739812132055.issue24234@roundup.psfhosted.org>
In-reply-to
Content
> If SupportsComplex and SupportsBytes are just for "has __complex__/__bytes__ method", they are virtually useless.

I agree that "SupportsComplex" isn't directly useful in user-land. I think its main value is as a building block in things like `Union[SupportsComplex, SupportsFloat, SupportsIndex]`.

For me, the gain from implementing complex.__complex__ is that the test "can be used as a complex number" can now be expressed purely in terms of the protocols offered, without reference to concrete types.
History
Date User Action Args
2021-08-23 10:05:09mark.dickinsonsetrecipients: + mark.dickinson, gvanrossum, terry.reedy, serhiy.storchaka, ethan smith, corona10, gyu-don
2021-08-23 10:05:09mark.dickinsonsetmessageid: <1629713109.9.0.0739812132055.issue24234@roundup.psfhosted.org>
2021-08-23 10:05:09mark.dickinsonlinkissue24234 messages
2021-08-23 10:05:09mark.dickinsoncreate