Ethan Furman wrote:
Tim Chase wrote:
If it came in as an effortless (i.e. O(1) where I do it once and never
again; not an O(n) where n=the number of times I invoke Python)
default replacement for dir(), I'd reach for it a lot more readily. I
seem to recall there's some environment-var or
On Jun 30, 11:29 pm, Steven D'Aprano steve
+comp.lang.pyt...@pearwood.info wrote:
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:
meh,
I
On Jul 1, 12:20 pm, Tim Chase python.l...@tim.thechases.com wrote:
If it came in as an effortless (i.e. O(1) where I do it once and
never again; not an O(n) where n=the number of times I invoke
Python) default replacement for dir(), I'd reach for it a lot
more readily. I seem to recall
On Wed, Jul 13, 2011 at 7:46 AM, rantingrick rantingr...@gmail.com wrote:
[x for x in dir([]) if not x.startswith('_')]
['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
'reverse', 'sort']
Because we have plenty of room for args in this function...
dir(verbose=False)
On 06/30/2011 11:29 PM, Steven D'Aprano wrote:
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:
Comments and improvements welcome.
Having not
Tim Chase wrote:
If it came in as an effortless (i.e. O(1) where I do it once and never
again; not an O(n) where n=the number of times I invoke Python) default
replacement for dir(), I'd reach for it a lot more readily. I seem to
recall there's some environment-var or magic file-name that
Tim Chase wrote:
On 06/30/2011 11:29 PM, Steven D'Aprano wrote:
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:
Comments and improvements
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/54-enhancing-dir-with-globs/
E.g. instead of this: