Re: [Python-Dev] Subclasses vs. special methods

2014-01-06 Thread Walter Dörwald
On 04.01.14 13:58, Serhiy Storchaka wrote: Should implicit converting an instance of int, float, complex, str, bytes, etc subclasses to call appropriate special method __int__ (or __index__), __float__, __complex__, __str__, __bytes__, etc? Currently explicit converting calls these methods, but

[Python-Dev] Subclasses vs. special methods

2014-01-04 Thread Serhiy Storchaka
Should implicit converting an instance of int, float, complex, str, bytes, etc subclasses to call appropriate special method __int__ (or __index__), __float__, __complex__, __str__, __bytes__, etc? Currently explicit converting calls these methods, but implicit converting doesn't. class I(int