A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/1999-September/000880.html below:

[Python-Dev] Relative Package Imports

[Python-Dev] Relative Package ImportsJim Fulton jim@digicool.com
Tue, 14 Sep 1999 13:24:10 +0000
"James C. Ahlstrom" wrote:
> 
> Jim Fulton wrote:
> >
> > "M.-A. Lemburg" wrote:
> > > In the end, having written a self-contained package is a "feature"
> > > of that package. Other authors can then say: ok, I can
> > > plugin your package if it's self-contained.
> >
> > Well said.  It really should be possible to provide
> > *self-contained* package hierarchies.
> 
> > There are at
> > least two people in this discussion that are trying hard to
> > make use of packages and have observed a significant problem.
> 
> OK, just to make sure I understand this.  You are saying that
> a ".." operation is needed in imports so that a package author
> with a package which looks like this:
>   mypackage
>   mypackage/sub1/mod1.py
>   mypackage/sub2/mod2.py
> 
> can write "import __.sub2.mod2" instead of "import mypackage.sub2.mod2"
> within the file mod1.py.  Right?

Yup.

Note that sys.modules would still have the absolute paths
for keys.

Jim

--
Jim Fulton           mailto:jim@digicool.com
Technical Director   (888) 344-4332              Python Powered!
Digital Creations    http://www.digicool.com     http://www.python.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4