(object, predicate=None)
return results
Return all members of an object as (name, value) pairs sorted by name.

    Optionally, only return members that satisfy a given predicate.
Return all members of an object as (name, value) pairs sorted by name.
Return all members of an object as ( name value ) pairs sorted by name .
def inspect_getmembers(object, predicate=None):
    """Return all members of an object as (name, value) pairs sorted by name.

    Optionally, only return members that satisfy a given predicate.
    """

    results = []
    for key in dir(object):
        try:
            value = getattr(object, key)
        except AttributeError:
            continue
        if not predicate or predicate(value):
            results.append((key, value))
    results.sort()
    return results
def inspect_getmembers ( object , predicate = None ) : results = [ ] for key in dir ( object ) : try : value = getattr ( object , key ) except AttributeError : continue if not predicate or predicate ( value ) : results . append ( ( key , value ) ) results . sort ( ) return results