[Python-ideas] dir with a glob?

Stefan Behnel stefan_ml at behnel.de
Fri Jul 1 08:15:13 CEST 2011


Terry Reedy, 01.07.2011 01:38:
> On 6/30/2011 8:41 AM, Joao S. O. Bueno wrote:
>
>> I believe a second parameter to dir, being a glob filter string, would be
>> fine. Being able to type:
>>
>> dir (gtk.Window, "set*")
>>
>> , for example
>> instead of
>>
>> [attrib for attrib in dir(gtk.Window) if attrib.startswith("set")]
>>
>>
>> would be indeed a good thing to have.
>
> Ihad much the same thought. I am still trying to see what is wrong with it.
> It might be worth a feature request.

Same from here, seems to be the most obvious way to do it.

Stefan




More information about the Python-ideas mailing list