[issue35181] Doc: Namespace Packages: Inconsistent documentation of __loader__ being None

Géry report at bugs.python.org
Wed Nov 7 10:13:59 EST 2018


Géry <gery.ogam at gmail.com> added the comment:

It looks like Barry Warsaw has not been fully updated the documentation after making the __spec__.loader attribute match with the __loader__ attribute, and the __spec__.file attribute match with the __file__ attribute for namespace packages.

Here is a pull request to update the library documentation of importlib (your first link [1]) with the current Barry's implementation:
https://github.com/python/cpython/pull/10016

Here is another pull request to update the reference documentation of the import system (your second link [2], but for a different paragraph, as I think the "To indicate to the import machinery that the spec represents a namespace portion the path entry finder sets “loader” on the spec to None" sentence is correct, since the `_bootstrap.ModuleSpec.loader` attribute of a namespace package remains `None` until the call to the `importlib._bootstrap._init_module_attrs` function):
https://github.com/python/cpython/pull/10376

----------
nosy: +brett.cannon, eric.snow, maggyero, ncoghlan

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35181>
_______________________________________


More information about the Python-bugs-list mailing list