Against PEP 240

Nick Perkins nperkins7 at home.com
Wed May 30 18:42:59 EDT 2001


"Robin Becker" <robin at jessikat.fsnet.co.uk> wrote in message
> ... the word here is 'forced' I don't want this and I don't  want an
> easy way into possibly very large computations ie let's use rationals
> and Newton's method to solve for a root of x^2 = 2
>
> A naive user might expect an exact result.

..but Newton's method specifies that you stop your calculations when you
reach a certain 'small enough' value, ie.  stop when you get close enough to
the result, where you can specify what is 'close enough' Anyone implementing
the methoud would realize that there is a 'built-in' inaccuracy.

What about a user using a built-in sqrt(x) function, who supplies a rational
argument?  Will the naive user be aware that the result is not rational?  Or
would that function actually return a rational which is close to the anser?

If conversion was done by default, and the square-root is actually a
rational, would it be returned as a rational or converted?

This could introduce a different 'surprise' to newbies.







More information about the Python-list mailing list