
June 30, 2011
1:38 p.m.
Often when exploring an object with the 'dir' function, particularly in large packages like SciPy, I find that I need to filter the outout. Since a dir reminds me of a dos 'dir' or linux 'ls', a glob feels like the most natural to use. For example, none of these would work:
dir(sp.fft.i*) # syntax error dir('sp.fft.i*') # returns the attributes a string
I believe a new dir functions is needed, or a change in the behviour of the current version. Of course a 'glob aware dir function' can be implemented by monitoring the call stack (cf. sys._getframe().f_back), but I think the problem is general enough to warrant an official sultion. Sturla