summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-08-01 20:58:53 (GMT)
committerGeorg Brandl <georg@python.org>2011-08-01 20:58:53 (GMT)
commitaa71583f09a39becfb3df55dc440820f33925029 (patch)
tree3a4cd93cfcb696888d8e9cab20824282a6e802ba
parentccf03a1cdcf1f108ca41b4f60821de40c1b695e2 (diff)
downloadcpython-aa71583f09a39becfb3df55dc440820f33925029.zip
cpython-aa71583f09a39becfb3df55dc440820f33925029.tar.gz
cpython-aa71583f09a39becfb3df55dc440820f33925029.tar.bz2
Use attribute access instead of index access for namedtuple.
-rw-r--r--Doc/library/stat.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/stat.rst b/Doc/library/stat.rst
index 4f79689..7de98b6 100644
--- a/Doc/library/stat.rst
+++ b/Doc/library/stat.rst
@@ -87,7 +87,7 @@ Example::
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)