Ian Kelly <ian.g.ke...@gmail.com>: > On Wed, Mar 19, 2014 at 4:09 AM, Marko Rauhamaa <ma...@pacujo.net> wrote: >> So complex(a, b) is documented to produce a+bj when a and b are integers >> or floats. What's more natural than saying it produces a+bj when a and b >> are complex numbers? It's a straightforward generalization that in no >> way violates the more limited documentation. > > When is it ever useful though? [...] It would be better to raise an > exception in either of the cases above, in my opinion.
I don't think it matters one way or another. Medieval mathematicians had to address an analogous issue when they had to decide if x + 0 was meaningful. After all, adding nothing doesn't make any sense and should raise a ValueError exception... Marko -- https://mail.python.org/mailman/listinfo/python-list