Documentation
The module.__file__ section in Doc/reference/datamodel.rst has two problems:
- it says "Both attributes should be a
str" even though the section is describing a single attribute
- it does not clearly explain the path form readers should expect from
__file__
The docs should say that __file__ is optional, should be a str when set, and is usually an absolute path for modules loaded from a file by the import system, while callers that require an absolute path should normalize it explicitly.
Linked PRs
Documentation
The
module.__file__section inDoc/reference/datamodel.rsthas two problems:str" even though the section is describing a single attribute__file__The docs should say that
__file__is optional, should be astrwhen set, and is usually an absolute path for modules loaded from a file by the import system, while callers that require an absolute path should normalize it explicitly.Linked PRs