| Store | Cart

PEP 328: Imports: Multi-Line and Absolute/Relative

From: John Roth <news...@jhrothjr.com>
Wed, 10 Mar 2004 13:14:13 -0500
"Stephen Horne" <steve at ninereeds.fsnet.co.uk> wrote in message
news:k1hu40ll9e7e3snd8jiqc9trptntltmcke at 4ax.com...
> On Wed, 10 Mar 2004 08:04:22 -0500, "John Roth"> <newsgroups at jhrothjr.com> wrote:>> >> While that makes some sense, what about "uncle" references within the> >> current package?> >> >I'm not sure what you mean by "Uncle." The term usually> >means "parent's brother" or "some son of your grandparents> >other than your father" so I'd assume it would go up one> >directory and then sideways, which would require going up> >another directory.> >> >If you are refering to another module in the same directory> >that this one came from, then I'd code that as:> >> >import *.foo> >> >However, possibly you meant "cousin?">> That doesn't sound right either.>> A cousin is an uncles son. Maybe he meant sibling or brother.>> sibling = sideways ref> uncle   = up then sideways ref> cousin  = up then sideways ref then down>> OTOH, it depends where you consider the start point to be. It seems> pointless to have the start point as 'self', so maybe the start point> is 'father'. A simple reference would then be to a sibling (implicit> up then down) and a sideways reference to an uncle.>> I'm probably just confused, though I'd love to know exactly how.

Probably a lack of clarity on my part. The way I look at
it is:

If a letter is a directory (package) and a letter
and number is a module, then:

A is the grandfather
A.B is the father
A.B.B1 is the module that contains the import statement.
A.B.B2 is another module in the same package
A.B.D is a package that is a sibling of B1 and B2
A.B.D.D1 is a module in package D, and is therefore a nephew
A.C is an uncle (the father's sibling)
A.C.C1 is a cousin.
A.A1 is another uncle

* then refers to the package (directory) that
contains the module with the import statement.

^ refers to that package's parent directory.

*.B2 referes to a sibling of B1
^.C.C1 refers to a cousin of B1
^.A1 refers to a module in package A
*.D.D1 refers to the nephew D1

Hope this clarifies my way of looking at it.

John Roth
>>> -- > Steve Horne>> steve at ninereeds dot fsnet dot co dot uk

Recent Messages in this Thread
Aahz Mar 08, 2004 08:24 pm
John Roth Mar 09, 2004 01:04 am
Aahz Mar 10, 2004 10:49 am
John Roth Mar 10, 2004 01:04 pm
Stephen Horne Mar 10, 2004 04:44 pm
John Roth Mar 10, 2004 06:14 pm
Stephen Horne Mar 09, 2004 01:09 am
Mike Mar 09, 2004 03:39 am
Josiah Carlson Mar 09, 2004 06:34 am
Sean Ross Mar 09, 2004 06:13 pm
Paul Rubin Mar 09, 2004 10:44 pm
Josiah Carlson Mar 10, 2004 04:20 am
Andrew Clover Mar 10, 2004 01:18 pm
Sean Ross Mar 10, 2004 03:11 pm
Josiah Carlson Mar 12, 2004 07:06 am
Thomas Heller Mar 09, 2004 07:41 am
Andrew Clover Mar 09, 2004 10:12 am
Denis S. Otkidach Mar 09, 2004 10:50 am
Gerrit Mar 10, 2004 11:41 am
Anders J. Munch Mar 10, 2004 02:46 pm
Dieter Maurer Mar 11, 2004 10:29 pm
Geoff Howland Mar 14, 2004 12:50 am
Andrew Clover Mar 15, 2004 09:52 am
Bernhard Herzog Mar 15, 2004 11:26 am
Aahz Mar 10, 2004 11:01 am
John Roth Mar 10, 2004 01:13 pm
Messages in this thread