PEP: import version

Christopher Barker Chris.Barker at noaa.gov
Thu May 13 13:22:02 EDT 2004


Skip Montanaro wrote:
> Somehow that version has to map to a different file being loaded, so it
> seems to me the proper place to record this information is in sys.path (or
> before the program runs, PYTHONPATH).  Voila!  No syntax changes required.

This really needs to be done at runtime, not ahead of time with PYTHONPATH.

We have been discussing this over at wxPython-users, and a number f 
workable solutions have been proposed. However, it would be great if 
there was an "official" Pythonic way to do it, rather than each package 
author coming up with their own system. So, I'm all for a  PEP, even if 
it is just for a standard approach, and no change to python whatsoever. 
If someone is working on a proposal, you might want to consider these 
(from the wxPython Wiki):

Basic Goals:

     * Multiple versions of wxPython being installed at the same time
     * Two or more programs, each using a different version could run at 
once.
     * Easy for developers - for testing with multiple versions etc
     * Easy for users - their apps detect the right version to run with
     * Cross-Platform solution

More detail:

     * The ability for the programmer to specify the version used in the 
code, ideally only on (or before) the first import of wxPython
     * A default version that gets imported with "import wx", just like 
it's always been
     * The ability to specify the version wanted with an environment 
variable, so that multiple versions could be easily tested
     * The ability to specify multiple versions that all work, in a 
ordered list of some sort.
     * The ability to specify a "minimal" version, and higher versions 
could be used.
     * The ability for "from wx.lib import Something" to work as well, 
respecting the version

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov



More information about the Python-list mailing list