Future division patch available (PEP 238)

Gerd Woetzel woetzel at gmd.de
Wed Jul 25 12:02:16 CEST 2001


Chris Barker <chrishbarker at home.net> writes:

[...]
>As of Python 2.2 (or 2.3, whatever, as long as it is as soon as any
>backward incompatibility is introduced) require something at the top of
>every source file: a line like:

>#version 2.3

>This is now an indicator of what version of Python the code runs under.
>If that line is not there, it is assumed that it is for a version less
>that 2.3: In that case, the interpreter has a backward compatibility
>mode, and runs that code in that mode. This could probably be a change
>at the compiling level, and the resultant byte code could be compatible.

>The nice thing about this approach is that it:

>A) will not break old code. Ever. At all.

>B) It sets up a system for other changes that might be backward
>incompatible as well. Let them be few and far between!

>C) it restricts the different dialects to being only version changes,
>and only a one way street. I think this is a good thing: I don't want
>Python coders in the future to be able to use a version that has, for
>example:
>the old division, but case insensitive
[...]

Yes, *very* good -- and so simple!
(not so for the developers of new Python releases, of course)

Furthermore,

D) the Python compiler can give up with a nice user (customer)
   friendly error message like

   "This sofware needs at least Python version 2.3, please upgrade"

   or (e.g. Python 3000 might state that)

   "Cannot understand this ancient Python 2.3 stuff" 

>Guido, (and everyone else) I'd love to hear your take on this proposal,
>I'm sure it's full of holes, but I don't what they are. I started a
>thread about it, and have gotten responses, but no one has actually
>commented on the proposal itself.

I'm listening too ..
--
Gerd Woetzel            | email: gerd.woetzel at gmd.de
GMD FIT.CSCW            | phone: ++49 2241 142648 (fax: 142084)
D-53754 Sankt Augustin  | www:   http://orgwis.gmd.de/~woetzel/



More information about the Python-list mailing list