
June 30, 2011
3:27 p.m.
Den 30.06.2011 14:29, skrev Ben Finney:
We have list comprehensions and generator expressions to filter a sequence, and I suspect they would serve you well for this purpose.
Dir is often used to explore objects or modules interactively, which means we need a very short syntax for this to be handy. Perhaps something like this: dir(object, "foo*") Making an utility function like this with glob or regex is of course extremely simple. Anyone can do it for themselves, how ever they like. What I am asking is if the need to filter the output from dir is so common that it could warrant a change to Python? Sturla