Use attribute access instead of index access for namedtuple.
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 @@
 
        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)