Message313666
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. |
|
Date |
User |
Action |
Args |
2018-03-12 16:27:52 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, FHTMitchell |
2018-03-12 16:27:52 | serhiy.storchaka | set | messageid: <1520872072.64.0.467229070634.issue33055@psf.upfronthosting.co.za> |
2018-03-12 16:27:52 | serhiy.storchaka | link | issue33055 messages |
2018-03-12 16:27:52 | serhiy.storchaka | create | |
|