[Python-Dev] Relative import

Skip Montanaro skip at pobox.com
Thu Dec 18 08:50:12 EST 2003


    Andrew> Or it can be fixed by not having the entire standard library at
    Andrew> the toplevel, but instead inside a single "stdlib" package.
    ...
    Andrew> The backwards compatibility problems probably means this isn't
    Andrew> feasible until Python 3.0, though :(

Not necessarily.  It has been proposed (more than once I think) that such a
stdlib package could be created in parallel using symlinks.  At its
simplest, I think all you'd need would be a stdlib directory, a nearly empty
__init__.py file and symlinks to all the current standard modules and
packages.  (The __init__.py file would take care of importing builtin
modules.)

I would choose a very short name for such a package ("std" seems best) even
though it might create clashes because it will be used a lot.

Skip




More information about the Python-Dev mailing list