8 lines
184 B
Python
8 lines
184 B
Python
|
def xdir(obj, return_values=False):
|
||
|
for attr in dir(obj):
|
||
|
if attr[:2] != "__" and attr[-2:] != "__":
|
||
|
if return_values:
|
||
|
yield attr, getattr(obj, attr)
|
||
|
else:
|
||
|
yield attr
|