A way to accommodate laguage changes

Skip Montanaro skip at pobox.com
Tue Jul 24 07:59:30 EDT 2001


    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.

    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.

-- 
Skip Montanaro (skip at pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list