sys.modules.__file__ is optional
__file__
is optional. If set, this attribute’s value must be a string. The import system may opt to leave __file__
unset if it has no semantic meaning (e.g. a module loaded from a database).
__file__
is optional. If set, this attribute’s value must be a string. The import system may opt to leave __file__
unset if it has no semantic meaning (e.g. a module loaded from a database).