Scrap/Release/Code Finder.txt

13 lines
455 B
Text
Raw Permalink Normal View History

2015-03-01 11:03:11 -06:00
def 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):
value = getattr(object, key)
if not predicate or predicate(value):
results.append((key, value))
print key,value
results.sort()
return results
getmembers(messenger.send)