[Python-checkins] cpython (2.7): Use attribute access instead of index access for namedtuple.
georg.brandl
python-checkins at python.org
Mon Aug 1 22:59:25 CEST 2011
http://hg.python.org/cpython/rev/5acd6ca6c41a
changeset: 71681:5acd6ca6c41a
branch: 2.7
parent: 71675:8065f927b4f6
user: Georg Brandl <georg at python.org>
date: Mon Aug 01 22:58:53 2011 +0200
summary:
Use attribute access instead of index access for namedtuple.
files:
Doc/library/stat.rst | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Doc/library/stat.rst b/Doc/library/stat.rst
--- a/Doc/library/stat.rst
+++ b/Doc/library/stat.rst
@@ -84,7 +84,7 @@
for f in os.listdir(top):
pathname = os.path.join(top, f)
- mode = os.stat(pathname)[ST_MODE]
+ mode = os.stat(pathname).st_mode
if S_ISDIR(mode):
# It's a directory, recurse into it
walktree(pathname, callback)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list