Steven D'Aprano wrote: > The tutorial shouldn't talk about Python3000 at all. What would be the > point of that? The tutorial is there to teach about the way Python works > now, not to make guesses and prediction about how it will work some time > in the indefinite future.
There is no guessing involved. The new division behaviour was implemented years ago, but to avoid breaking old code, it's not enabled by default. For new code, you ought to use 'from __future__ import division' and use // whenever you want floor division, regardless of that numeric types you divide. The ordinary / shouldn't truncate fractions. The problem is that the tutorial doesn't tell python programmers to do this. I can understand that there is a pedagogical problem here. Division is introduced way earlier than the import statement in the tutorial, and the "from __future__" thingie might not be the first thing you want to expose for a beginner. -- http://mail.python.org/mailman/listinfo/python-list