[Python-Dev] Using and binding relative names (was Re: PEP for Better Control of Nested Lexical Scopes)

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Feb 23 03:49:42 CET 2006

Steven Bethard wrote:
>  And, as you mention, it's consistent
> with the relative import feature.

Only rather vaguely -- it's really somewhat different.

With imports, .foo is an abbreviation for myself.foo,
where myself is the absolute name for the current module,
and you could replace all instances of .foo with that.
But in the suggested scheme, .foo wouldn't have any
such interpretation -- there would be no other way of
spelling it.

Also, with imports, the dot refers to a single well-
defined point in the module-name hierarchy, but here it
would imply a search upwards throught the scope hierarchy.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiam!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+

More information about the Python-Dev mailing list