Name

getmembers

Synopsis

getmembers(obj, filter=None)

Returns all attributes (members) of obj, a sorted list of ( name,value ) pairs. When filter is not None, returns only attributes for which callable filter returns a true result when called on the attribute’s value, like:

[ (n, v) for n, v in getmembers(obj) if filter(v) ]

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.