Skip to main content

iterate_attributes

No overview available.

def iterate_attributes(
obj: object
) - > Iterator[Tuple[str, Any]]

Iterates over the attributes of an object and yields key-value pairs for all non-callable properties. This is useful for serializing object state or inspecting data-carrying attributes while ignoring methods and internal logic.

Parameters

NameTypeDescription
objobjectThe object instance whose attributes will be inspected and yielded.

Returns

TypeDescription
Iterator[Tuple[str, Any]]An iterator yielding tuples containing the attribute name and its corresponding value.