[Python-3000] Import system questions to be considered for Py3k

Nick Coghlan ncoghlan at gmail.com
Mon Jul 17 11:22:53 CEST 2006


A couple I accidentally left off my original list:

Rationalise *.pkg and *.pth files
---------------------------------

site.py processes *.pth files in the site-packages directory (the exact 
location being platform dependent) and adds things to sys.path as per the 
documentation of the site module.

pkgutil.extend_path processes *.pkg files as per the documentation of the 
pkgutil module.

*.pkg files are generally easier to handle than *.pth files - are the 
additional features of *.pth files really needed? What advantages do *.pth 
files offer over a normal Python module in site-packages (or anywhere else on 
the system path) that uses pkgutil.extend_path() to set the module's __path__ 
attribute?

Use an interpreter configuration file?
--------------------------------------

PYTHONPATH and the other interpreter controlling environment variables are 
shared between Python interpreters. This may cause problems if multiple 
versions of the interpreter are installed on a single machine.

On Windows, some additional configuration data is squirreled away in the 
Windows registry by the installer (although this data is at least version 
specific).

Jython deals with configuration aspects like PYTHONPATH in a cross-platform 
fashion by consulting a hierarchy of configuration data (system defaults, 
installation configuration file, user configuration file, command line 
argument overrides) [1].

In addition to being more consistent across platforms, the generic 
configuration file and -D property definition mechanism used by Jython is also 
more extensible than CPython's current approach of having to define a new 
command line switch or environment variable for each configurable option. 
Obviously, restraint would still be needed in the addition of configuration 
options in order to prevent a blowout in the number of scenarios requiring 
testing.

[1] http://www.jython.org/docs/registry.html


-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list