Having a __stdlib__ namespace?

Terry Hancock hancock at anansispaceworks.com
Fri Jan 10 19:56:39 EST 2003


Just wrote:
> In article <mailman.1042189529.2441.python-list at python.org>,
>  Lulu of the Lotus-Eaters <mertz at gnosis.cx> wrote:
> 
>> It doesn't come "out of the box" this way, but you could easily create
>> your own directory on the import path that was a link to the actual
>> library path.  And you could name it something like 'std' or '__std__'.
>> Once such a link was added, the OP's prefered import form will work.
> 
> Or you can add a regular dir named "std" somewhere, which contains an
> __init__.py like this:
> 
> __path__ = [<path-to-std-lib>]

Okay -- that should be portable across all platforms, so it's better than 
the symlink.  That's the way to do it -- no PEP needed (unless maybe to 
include this in the standard distribution).. :-D

Terry

-- 
Anansi Spaceworks
http://www.anansispaceworks.com




More information about the Python-list mailing list