[Python-ideas] Yet another sum function (fractions.sum)

random832 at fastmail.us random832 at fastmail.us
Wed Aug 21 16:19:12 CEST 2013


On Tue, Aug 20, 2013, at 18:47, Andrew Barnert wrote:
> So instead of math.sqrt and cmath.sqrt, we just have one function that
> decides whether sqrt(-1) is 0+1j or an exception based on guessing
> whether you wanted complex numbers? :)

Why exactly is an exception reasonable? If you don't want complex
numbers, don't take square roots of negative numbers. If you can't
handle complex numbers, you'll get an exception down the line anyway.


More information about the Python-ideas mailing list