[Python-ideas] Adding '**' recursive search to glob.glob

Bruce Leban bruce at leapyear.org
Tue Jan 15 05:03:08 CET 2013


On Mon, Jan 14, 2013 at 5:31 PM, Steven D'Aprano <steve at pearwood.info>wrote:

> Yuck, then the reader has to know what features are
>> enabled by which version numbers -- not something that's
>> easy to keep in one's head.
>>
>
>
> True. But neither are a plethora of enable_feature flags. Is it
> allow_recursion or allow_recursive or enable_double_star? Globbing
> is not likely to be something that most people use often enough that
> the name of the arguments will stick in their head. People will
> likely need to look it up one way or the other.
>

I see nothing wrong with asking people to consult the documentation for
features they don't use that frequently. Better to check the docs than get
it wrong. But the reader of the code is more likely to notice something
special is going on when they see glob(..., allow_recursive=True) then
rglob(...).

And I'd rather have flags than rglob to allow recursion and iglob to ignore
case and then either riglob or irglob to do both. Yuck.

--- Bruce
Check this out: http://bit.ly/yearofpuzzles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130114/85a25bee/attachment.html>


More information about the Python-ideas mailing list