Files
cpython/Doc/lib
Johannes Gijsbers 836f5433f7 Patch #943206:
`glob.glob()` currently calls itself recursively to build a list of matches of
the dirname part of the pattern and then filters by the basename part. This is
effectively BFS. ``glob.glob('*/*/*/*/*/foo')`` will build a huge list of all
directories 5 levels deep even if only a handful of them contain a ``foo``
entry. A generator-based recusion would never have to store these list at once
by implementing DFS. This patch converts the `glob` function to an `iglob`
recursive generator . `glob()` now just returns ``list(iglob(pattern))``.

I also cleaned up the code a bit (reduced duplicate `has_magic()` checks and
created a second `glob0` helper func so that the main loop need not be
duplicated).

Thanks to Cherniavsky Beni for the patch!
2005-01-08 13:13:19 +00:00
..
2004-03-25 16:14:17 +00:00
2004-10-03 09:41:26 +00:00
2004-11-04 05:45:44 +00:00
2004-08-31 13:21:07 +00:00
2004-07-10 11:15:56 +00:00
2005-01-05 06:58:15 +00:00
2004-11-25 05:35:32 +00:00
2005-01-05 07:03:53 +00:00
2005-01-05 07:19:11 +00:00
2005-01-08 13:13:19 +00:00
2004-05-11 05:29:34 +00:00
2004-06-06 16:51:46 +00:00
2005-01-07 02:50:22 +00:00
2004-03-26 17:11:10 +00:00
2004-05-22 16:38:11 +00:00
2004-08-31 13:49:36 +00:00
2005-01-08 12:31:29 +00:00
2004-08-07 19:10:36 +00:00
2004-08-31 13:05:59 +00:00
2004-07-17 13:35:43 +00:00
2004-07-13 14:03:31 +00:00
2004-10-25 21:35:17 +00:00