Runtime Data Attributes

function.__dict__

Mutable namespace for custom function attributes, separate from local variables and the special metadata descriptors.

Formal Syntax & Structure

python syntaxpython
f.__dict__

Return Value

dict

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

Working Example

Example Snippetpython
def f(): return 7f.label = 'demo'print(f.__dict__)
Python Reference