File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -353,7 +353,11 @@ Loaders must satisfy the following requirements:
353353 * The loader may set the ``__file__ `` attribute of the module. If set, this
354354 attribute's value must be a string. The loader may opt to leave
355355 ``__file__ `` unset if it has no semantic meaning (e.g. a module loaded from
356- a database).
356+ a database). If ``__file__ `` is set, it may also be appropriate to set the
357+ ``__cached__ `` attribute which is the path to any compiled version of the
358+ code (e.g. byte-compiled file). The file does not need to exist to set this
359+ attribute; the path can simply point to whether the compiled file would
360+ exist (see :pep: `3147 `).
357361
358362 * The loader may set the ``__name__ `` attribute of the module. While not
359363 required, setting this attribute is highly recommended so that the
You can’t perform that action at this time.
0 commit comments