S
Steven D'Aprano
The dir() function is designed for interactive use, inspecting objects for
the names of attributes and methods.
Here is an enhanced version that allows you to pass a glob to filter the
names you see:
http://code.activestate.com/recipes/577774-enhancing-dir-with-globs/
E.g. instead of this:
['__add__', '__class__',
... snip 60+ other names ...
'upper', 'zfill']
you can easily filter the results to show only names that interest you, by
passing a glob:
['rsplit', 'split', 'splitlines']
Comments and improvements welcome.
the names of attributes and methods.
Here is an enhanced version that allows you to pass a glob to filter the
names you see:
http://code.activestate.com/recipes/577774-enhancing-dir-with-globs/
E.g. instead of this:
['__add__', '__class__',
... snip 60+ other names ...
'upper', 'zfill']
you can easily filter the results to show only names that interest you, by
passing a glob:
['rsplit', 'split', 'splitlines']
Comments and improvements welcome.