[Python-Dev] Re: PEP 328 -- relative and multi-line import

Greg Ewing greg at cosc.canterbury.ac.nz
Tue Apr 6 23:58:56 EDT 2004


Aahz <aahz at pythoncraft.com>:

> > Would it be unreasonable to define "." as meaning the current
> > *package*, rather than the current *module* --
> 
> Not unreasonable, but I think it complicates the explanation. 

Not if the explanation simply says "'.' refers to the
current package", and leaves the reader to deduce what
"current package" means when the module is not a
package. :-) [1]

My intuition is that this will actually cause people
less surprises even if they never think about this
subtlety before diving in and using the feature. In
fact they'll probably be more confused if they *do*
think about it, either way...

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+

Footnotes:
[1] A footnote explaining it would be allowed.



More information about the Python-Dev mailing list