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 serhiy.storchaka
Recipients FHTMitchell, serhiy.storchaka
Date 2018-03-12.16:27:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1520872072.64.0.467229070634.issue33055@psf.upfronthosting.co.za>
In-reply-to
Content
This isn't one exception. For example complex doesn't have the __complex__ method.

__str__, __float__, __int__ and __bool__ are implemented in str, float, int and bool because there are corresponding special slots in a type object. But __bytes__ and __complex__ were added later and they have no slots. Calling them for bytes and complex will slowdown creating new object.

The user code rarely needs to call these methods directly. Just call bytes(), complex(), str(), float(), etc.
History
Date User Action Args
2018-03-12 16:27:52serhiy.storchakasetrecipients: + serhiy.storchaka, FHTMitchell
2018-03-12 16:27:52serhiy.storchakasetmessageid: <1520872072.64.0.467229070634.issue33055@psf.upfronthosting.co.za>
2018-03-12 16:27:52serhiy.storchakalinkissue33055 messages
2018-03-12 16:27:52serhiy.storchakacreate