[Python-Dev] installation points (was: Great Renaming? What is the goal?)

Greg Stein gstein@lyra.org
Wed, 29 Mar 2000 18:54:27 -0800 (PST)


On Wed, 29 Mar 2000, Gordon McMillan wrote:
> Moshe Zadka wrote:
> > On Tue, 28 Mar 2000, Gordon McMillan wrote:
> > > What would happen if he (and everyone else) installed 
> > > themselves *into* my core packages, then I decided I didn't 
> > > want his stuff? More than likely I'd have to scrub the damn 
> > > installation and start all over again.
> > 
> > I think Greg Stein answered that objection, by reminding us that the
> > filesystem isn't the only way to set up a package hierarchy.
> 
> You mean when Greg said:
> >Assuming that you use an archive like those found in my "small" distro or
> > Gordon's distro, then this is no problem. The archive simply recognizes
> > and maps "text.encoding.macbinary" to its own module.
> 
> I don't know what this has to do with it. When we get around 
> to the 'macbinary' part, we have already established that 
> 'text.encoding' is the parent which should supply 'macbinary'.

good point...

> >  In
> > particular, even with Python's current module system, there is no need to
> > scrub installations: Python core modules go (under UNIX) in
> > /usr/local/lib/python1.5, and 3rd party modules go in
> > /usr/local/lib/python1.5/site-packages. 
> 
> And if there's a /usr/local/lib/python1.5/text/encoding, there's 
> no way that /usr/local/lib/python1.5/site-
> packages/text/encoding will get searched.
> 
> I believe you could hack up an importer that did allow this, and 
> I think you'd be 100% certifiable if you did. Just look at the 
> surprise factor.
> 
> Hacking stuff into another package is just as evil as math.pi = 
> 42.

Not if the package was designed for it. For a "package" like "net", it
would be perfectly acceptable to allow third-parties to define that as
their installation point.

And yes, assume there is an importer that looks into the installed
archives for modules. In the example, the harder part is determining where
the "text.encoding" package is loaded from. And yah: it may be difficult
to arrange the the text.encoding's importer to allow for archive
searching.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/