On 2015-01-25 at 02:56:43 -0300, Werner Almesberger wrote: > Bas Wijnen wrote: > > If you want to be future-proof, you probably want to use python3, in > > which 3/2 == 1.5 (and 4/2 == 2.0, not 2); you have to specify integer > > division explicitly as 3//2 there. > Oooh, that explains everything. That's a pretty fundamental change to > make in a widely deployed language. > [...] > Hmm, just saw that they removed (converted) the print statement in > version 3. And I thought the gcc folks were reckless ;-)
Python 3.0 was designed explicitely to allow for fundamental changes that broke compatibility: in a way it can be considered almost a (close) derivative of python 2.x rather than a version of the same language. Some changes were however backported to python2 and it is possible to write at least some code that is able to run under both 2 and 3 by importing the relevant changes from __future__; it is the first approach listed on https://wiki.python.org/moin/PortingPythonToPy3k You can use just the new division behaviour by importing ``division`` from __future__, or you can import all of the four modules and try to keep the code running under both versions. -- Elena ``of Valhalla'' _______________________________________________ Qi Hardware Discussion List Mail to list (members only): [email protected] Subscribe or Unsubscribe: http://lists.en.qi-hardware.com/mailman/listinfo/discussion

