A way to accommodate laguage changes

Terry Reedy tjreedy at home.com
Tue Jul 24 12:23:36 EDT 2001


"Skip Montanaro" <skip at pobox.com> wrote in message
news:mailman.995975980.22956.python-list at python.org...
>     Terry> To run newly written code under old versions of the
interpreter,
>     Terry> you have to eschew *all* features added after the oldest
version
>     Terry> you want to support.  For 1.5.2, this means list
comprehensions,
>     Terry> augmented assignments, nested scopes, iterators,
generators,
>     Terry> type-class unification features, and what ever else is
next
>     Terry> added.
>
> Yeah, but that presumes that the features you do use don't change
meaning.

Exactly

>     Terry> For the proposed division change, the 'new' meanings will
be
>     Terry> int/int and float//float.  So write float(int)/int and
>     Terry> floor(float/float) instead.  Only write int//int or
float/float.
>     Terry> With the tokenizer module, it will then be easy to change
all
>     Terry> instances of int//int to int/int (old meaning).
>
> Interesting solution.

which is based on the forward-conversion program that I believe you
posted.  Both should be part of the transition package distributed
with 2.2+.

Terry J. Reedy






More information about the Python-list mailing list