This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gwideman
Recipients Greg.Slodkowicz, brett.cannon, docs@python, eric.araujo, gwideman, ncoghlan, pje
Date 2011-06-11.15:32:35
SpamBayes Score 6.673284e-11
Marked as misclassified No
Message-id <1307806356.98.0.910923288986.issue11553@psf.upfronthosting.co.za>
In-reply-to
Content
Hi Nick: Thanks for your additional points. Comments inline:

> __all__ only affects import *, and may also affect documentation tools (e.g. pydoc will respect __all__ when deciding what to display). It has no effect on attribute retrieval from modules.

That's indeed my understanding. So the doc (6. Simple statements) which says that __all__ determines the list of "public names" is a bit of a red herring.  Attributes are accessible (ie: public) regardless of whether on the __all__ list.  Instead the __all__ list establishes the list of names imported by *, and makes those names reference-able without a module prefix. (Plus gives hints about intent to doc tools.)

> pkgutil.extend_path() is used to modify pkg.__path__ attributes, *not* sys.path. 

Understood, and perhaps my point was obtuse.  I was pointing out that the doc for extend_path discusses .pkg entries which point to package dirs, and that this, it says, is like .pth files. I claim that an entry in a .pth files should NOT point to a package dir, but rather to one level up: to a dir that *contains* package dirs. (Pointing a .pth entry directly at a package dir will break package behavior by exposing the constituent modules to sys.path.)  Hence the doc for extend_path is misleadingly suggesting a wrong idea about .pth files.
History
Date User Action Args
2011-06-11 15:32:37gwidemansetrecipients: + gwideman, brett.cannon, pje, ncoghlan, eric.araujo, docs@python, Greg.Slodkowicz
2011-06-11 15:32:36gwidemansetmessageid: <1307806356.98.0.910923288986.issue11553@psf.upfronthosting.co.za>
2011-06-11 15:32:36gwidemanlinkissue11553 messages
2011-06-11 15:32:35gwidemancreate