Runtime Data Attributes

code.co_qualname

Qualified lexical name in compiled code, added in Python 3.11. It is independent of later changes to function-level naming metadata.

Formal Syntax & Structure

python syntaxpython
code.co_qualname

Return Value

str

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

Working Example

Example Snippetpython
def outer():    def inner(): pass    return innerf = outer(); code = f.__code__print(code.co_qualname)
Python Reference