python file versioning

Diez B. Roggisch deetsNOSPAM at
Mon Oct 25 15:27:49 CEST 2004

You can always have conditional imports based on the interpreter version
like this:

import sys

if sys.version_info[:2] == (2,2):
    from __future__ import nifty_feature

And you can extend that to class definitions and the like, too. And
import-hooks might help, too.


Diez B. Roggisch

More information about the Python-list mailing list