Author serhiy.storchaka
Recipients gvanrossum, serhiy.storchaka
Date 2020-10-08.06:55:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1602140125.13.0.506221233573.issue41974@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-10-08 06:55:25serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum
2020-10-08 06:55:25serhiy.storchakasetmessageid: <1602140125.13.0.506221233573.issue41974@roundup.psfhosted.org>
2020-10-08 06:55:25serhiy.storchakalinkissue41974 messages
2020-10-08 06:55:25serhiy.storchakacreate