Nasty typo in PEP 238 (revised)
Andrew Koenig
ark at research.att.com
Fri Jul 27 13:53:28 EDT 2001
David> In article <cp4rrz5onj.fsf at cj20424-a.reston1.va.home.com>,
David> 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.
David> Shouldn't this be float(x)/y ?
What if x is complex?
--
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark
More information about the Python-list
mailing list