Runtime Data Attributes

module.__dict__

Live module namespace, holding module-level bindings and metadata. The attribute itself is read-only; its entries can be changed.

Formal Syntax & Structure

python syntaxpython
module.__dict__

Return Value

dict

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

Working Example

Example Snippetpython
from types import ModuleTypem = ModuleType('demo'); m.count = 4print(m.__dict__['count'])
Python Reference