Those two controversial 2nd & 3rd paragraphs of my ch 1

Peter Otten __peter__ at web.de
Wed Jan 13 10:01:13 EST 2010


Alf P. Steinbach wrote:

> As of this writing two main variants of the Python language are in use,
> namely Python 2.x and Python 3.x (versions 3.0 and greater). Mostly
> they’re the same but the effect of e.g. the / division operator changed in
> 3.0, so  in practice it’s very hard to create programs that work the same 
> –  or even just work  – with both variants. The examples and discussion in
> this book assume Python version 3.1.1 or later.

It may be hard to support Python 2 and 3 with the same script, but the 
division operator is not a good example to support that statement because 
you can get the 3.x behaviour in 2.x with a simple

from __future__ import division 

at the top of the module.

Peter 




More information about the Python-list mailing list