[Python-Dev] PEP 366 is unclear about what it specifies

Brett Cannon brett at python.org
Tue Aug 7 23:26:48 CEST 2012


On Tue, Aug 7, 2012 at 4:52 PM, Stefan Behnel <stefan_ml at behnel.de> wrote:

> Hi,
>
> could someone please add a sentence to PEP 366 that describes the actual
> content of the new "__package__" attribute (and thus, the PEP)?
>
> http://www.python.org/dev/peps/pep-0366/
>
> I had to read through almost the entire document to be assured that
> "__package__" is really supposed to contain a string and I had a hard time
> nailing down its content. The only real hint in there is the example, and
> even that is ambiguous.
>

Two things when it comes to understanding import now. One is that Barry's
heavy rewrite of the import docs makes all of this much clearer and thus
should be used as the reference over the PEPs, e.g.
http://docs.python.org/dev/py3k/reference/import.html?highlight=__package__#loaders
explains
how __package__ should be set very clearly (yes, it references PEP 366 for
nitty-gritty discussion and details, but honestly there isn't anything in
the PEP that he didn't explain in the reference).

Two is that importlib makes it fairly straight-forward to read the source
code to understand how some aspect of imports work and should be clear
enough to not require reading PEPs to understand how a feature works.

Honestly, updating the PEPs constantly is a pain. We have code and docs
already that most users follow, so worrying about constantly touching up
PEPs is simply a third thing to have to keep track of that a majority of
our users will never see. I know I don't plan to touch PEP 302 anymore in
order to keep things straight in that doc as it's more hassle than it's
worth.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120807/1229cd17/attachment.html>


More information about the Python-Dev mailing list