Message400127
> 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. |
|
Date |
User |
Action |
Args |
2021-08-23 10:05:09 | mark.dickinson | set | recipients:
+ mark.dickinson, gvanrossum, terry.reedy, serhiy.storchaka, ethan smith, corona10, gyu-don |
2021-08-23 10:05:09 | mark.dickinson | set | messageid: <1629713109.9.0.0739812132055.issue24234@roundup.psfhosted.org> |
2021-08-23 10:05:09 | mark.dickinson | link | issue24234 messages |
2021-08-23 10:05:09 | mark.dickinson | create | |
|