classification
Title: language reference describes the role of module.__file__ inaccurately
Type: Stage: needs patch
Components: Documentation Versions: Python 3.4, Python 3.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: barry, brett.cannon, docs@python, eric.snow, ncoghlan
Priority: normal Keywords:

Created on 2014-06-14 20:33 by eric.snow, last changed 2014-06-14 20:35 by eric.snow.

Messages (1)
msg220578 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2014-06-14 20:33
The language reference [1] says:

  Ultimately, the loader is what makes use of __file__ and/or __cached__

This implies that loaders should use __file__ and __cached__ when loading a module.  Instead loaders are meant to implement exec_module() and use the spec that's passed in.

The entire section should have a clear note that loaders are not meant to rely a module's import-related attributes.

[1] https://docs.python.org/3/reference/import.html#__file__
[2] https://docs.python.org/3/reference/import.html#import-related-module-attributes
History
Date User Action Args
2014-06-14 20:35:11eric.snowsetassignee: docs@python

nosy: + docs@python
components: + Documentation
stage: needs patch
2014-06-14 20:33:24eric.snowcreate