diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-11-22 16:53:46 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-11-22 16:53:46 (GMT) |
commit | 7f13cfa6741ce4a3b5557a9bc10de302dabccd90 (patch) | |
tree | 5f641a865d03d8437d7bd621dbe5443993aca640 | |
parent | 919a3b40f9753aa7a9ce8efee9fad04919dd2929 (diff) | |
download | cpython-7f13cfa6741ce4a3b5557a9bc10de302dabccd90.zip cpython-7f13cfa6741ce4a3b5557a9bc10de302dabccd90.tar.gz cpython-7f13cfa6741ce4a3b5557a9bc10de302dabccd90.tar.bz2 |
os.walk(): Changed the "sum of bytes consumed by files" example to use
a generator expression instead of a listcomp.
Not a backport candidate (genexps are new in 2.4).
-rw-r--r-- | Doc/lib/libos.tex | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/lib/libos.tex b/Doc/lib/libos.tex index 91923c4..402f678 100644 --- a/Doc/lib/libos.tex +++ b/Doc/lib/libos.tex @@ -1174,7 +1174,7 @@ import os from os.path import join, getsize for root, dirs, files in os.walk('python/Lib/email'): print root, "consumes", - print sum([getsize(join(root, name)) for name in files]), + print sum(getsize(join(root, name)) for name in files), print "bytes in", len(files), "non-directory files" if 'CVS' in dirs: dirs.remove('CVS') # don't visit CVS directories |