PEP: import version

Peter Otten __peter__ at web.de
Thu May 13 05:44:54 EDT 2004


Manlio Perillo wrote:

> A possible syntax is this:
> import wxPython version '2.4'

Why not just

import wxPython2_4 as wxPython

and a symlink or something equivalent pointing to the latest version
to also allow

import wxPython

> Another case is when the module is implemented also in C:
> import picke version 'C'

Presenting the user with the choice of two equivalent modules is a mistake
IMHO. Just rename cPickle to pickle and move pickle.py into the
docs/demo/educational section. Or, more general, provide a Python version
as a fallback:

<pickle.py>
try
    # try 
    from cPickle import * 
except ImportError:
    # python implementation
</pickle.py>

Peter





More information about the Python-list mailing list