Message378218
The complex class has special methods which always raise a TypeError:
__int__
__float__
__floordiv__
__mod__
__divmod__
After removing them the corresponding operations (converting to int and float, operators // and %, function divmod()) will still a TypeError.
Advantages of removing:
* Less code to maintain.
* More uniform error messages.
* Clearer output of help().
* Possibility to implement a type with __rfloordiv__, __rmod__ and __rdivmod__ which support complex numbers. |
|
Date |
User |
Action |
Args |
2020-10-08 06:55:25 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gvanrossum |
2020-10-08 06:55:25 | serhiy.storchaka | set | messageid: <1602140125.13.0.506221233573.issue41974@roundup.psfhosted.org> |
2020-10-08 06:55:25 | serhiy.storchaka | link | issue41974 messages |
2020-10-08 06:55:25 | serhiy.storchaka | create | |
|