Runtime Data Attributes

function.__name__

Short callable name. Renaming this metadata does not rename the variable that refers to the function.

Formal Syntax & Structure

python syntaxpython
f.__name__

Return Value

str

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

Working Example

Example Snippetpython
def f(): return 7print(f.__name__)
Python Reference