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 mark.dickinson, serhiy.storchaka
Date 2012-10-20.12:41:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <201210201540.58186.storchaka@gmail.com>
In-reply-to <1350734177.95.0.540926194354.issue16290@psf.upfronthosting.co.za>
Content
> My interpretation of that is that __int__ should return an int, __float__ a
> float, __complex__ a complex number; 

It's a reasonable interpretation. Changing it can be confusing.

On the other hand, int and float look like specialized subclasses of complex 
(they even have .real, .imag and .conjugate()). The ducktype principle 
requires that we can use ints or floats everywhere where complexes needed. This 
means that you should add a branch for integers too.
History
Date User Action Args
2012-10-20 12:41:13serhiy.storchakasetrecipients: + serhiy.storchaka, mark.dickinson
2012-10-20 12:41:13serhiy.storchakalinkissue16290 messages
2012-10-20 12:41:13serhiy.storchakacreate