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 mdk
Recipients docs@python, mdk
Date 2018-11-06.22:29:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1541543349.68.0.788709270274.issue35181@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation states that a __loader__ of a namespace package should be None:

- [1] "For namespace packages this should be set to None."
- [2] "To indicate to the import machinery that the spec represents a namespace portion. the path entry finder sets “loader” on the spec to None".

But this looks wrong [3], looks like it has been changed in [4]/[5].

I think one should rely on __file__ being None on namespace packages (which make sense as they span over multiple directories) instead of __loader__ being None (a side effect of the import machinery ?).


[1]: https://docs.python.org/3/library/importlib.html#importlib.machinery.ModuleSpec.loader
[2]: https://docs.python.org/3/reference/import.html#path-entry-finder-protocol
[3]: https://stackoverflow.com/questions/52869541/namespace-package-spec-loader-and-loader-attributes-not-set-to-none
[4]: https://bugs.python.org/issue32303
[5]: https://github.com/python/cpython/pull/5481/files#diff-a6592cec2ebc8dba9bbf7d396370b138L319
History
Date User Action Args
2018-11-06 22:29:09mdksetrecipients: + mdk, docs@python
2018-11-06 22:29:09mdksetmessageid: <1541543349.68.0.788709270274.issue35181@psf.upfronthosting.co.za>
2018-11-06 22:29:09mdklinkissue35181 messages
2018-11-06 22:29:09mdkcreate