On 10/21/2012 5:45 AM, Mark Dickinson wrote:
On Sun, Oct 21, 2012 at 6:26 AM, Greg Ewing <greg.ew...@canterbury.ac.nz> wrote:
I think I've changed my mind on this, since it was pointed
out that if you're going to return a float instead of a
complex, you should really be implementing __float__, not
__complex__.

Yes, I'm wavering on this, too.  I'm reasonably convinced that the
complex constructor is wrong to accept a float return from
__complex__.  But it's not clear to me whether it's better to break
backwards compatibility by fixing that in 3.4, or to accept the
mistake and make cmath behave analogously.

I think we should fix it. A float return appears very rare, as well as wrong.


--
Terry Jan Reedy

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to