waling a directory with very many files

Christian Heimes lists at cheimes.de
Mon Jun 15 02:06:18 CEST 2009


Terry Reedy wrote:
> You did not specify version.  In Python3, os.walk has become a generater
> function.  So, to answer your question, use 3.1.

I'm sorry to inform you that Python 3.x still returns a list, not a
generator.


ython 3.1rc1+ (py3k:73396, Jun 12 2009, 22:45:18)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> type(os.listdir("."))
<class 'list'>

Christian




More information about the Python-list mailing list