[Python-ideas] dir with a glob?

Steven D'Aprano steve at pearwood.info
Fri Jul 1 06:17:14 CEST 2011


Sturla Molden wrote:
> 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.


I have added a recipe for this here:

http://code.activestate.com/recipes/577774-enhancing-dir-with-globs/

Comments and improvements welcome.



-- 
Steven



More information about the Python-ideas mailing list