Runtime Data Attributes

module.__loader__

Legacy loader metadata. Prefer __spec__.loader; the import system is moving away from the standalone field. A synthetic module can have no loader.

Formal Syntax & Structure

python syntaxpython
module.__loader__

Return Value

object | None

Value exposed by this attribute; availability and mutability depend on the owner as described.

Working Example

Example Snippetpython
from types import ModuleTypem = ModuleType('demo')print(m.__loader__ is None)
Python Reference