
David Scherer posted an interesting proposal to the idle-dev list for dealing with the incompatibility issues around int division. Bruce Sherwood also posted an interesting discussion there on how to deal with incompatibilities in general (culminating in a recommendation of David's solution). In brief, David abuses the "global" statement at the module level to implement a pragma. Not ideal, but kind of cute and backwards compatible -- this can be added to Python 1.5 or even 1.4 code without breaking! He proposes that you put "global olddivision" at the top of any file that relies on int/int yielding an int; a newer Python can then default to new division semantics. (He does this by generating a different opcode, which is also smart.) It's time to start thinking about a transition path -- Bruce's discussion and David's proposal are a fine starting point, I think. --Guido van Rossum (home page: http://www.python.org/~guido/)
participants (1)
-
Guido van Rossum