Nasty typo in PEP 238 (revised)
David Eppstein
eppstein at ics.uci.edu
Thu Jul 26 21:40:08 EDT 2001
In article <cp4rrz5onj.fsf at cj20424-a.reston1.va.home.com>,
Guido van Rossum <guido at python.org> wrote:
> Q. How do I write code that works under the classic rules as well
> as under the new rules without using // or a future division
> statement?
>
> A. Use x*1.0/y for true division, divmod(x, y)[0] for int
> division. Especially the latter is best hidden inside a
> function. You may also write floor(x)/y for true division if
> you are sure that you don't expect complex numbers.
Shouldn't this be float(x)/y ?
I still don't like the phrase "true division", it implies a value judgement
that quotients are somehow an inferior thing to want to compute.
--
David Eppstein UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/
More information about the Python-list
mailing list