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

Bruce Leban bruce at leapyear.org
Mon Jan 14 23:17:17 CET 2013


On Mon, Jan 14, 2013 at 1:38 PM, Greg Ewing <greg.ewing at canterbury.ac.nz>wrote:
> Steven D'Aprano wrote:
>> Rather than a flag, I suggest a version number:
>>>> glob.glob(pattern, version=1) # current behaviour, as of 3.3
>> glob.glob(pattern, version=2) # adds ** recursion in Python 3.4
>>>> 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.

And if you write glob.glob(..., foofeature=True) it will automatically
raise an exception if you use it in a version that doesn't support the
feature rather than silently ignoring the error.
--- 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/2551b053/attachment.html>


More information about the Python-ideas mailing list

AltStyle によって変換されたページ (->オリジナル) /