summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-07-29 18:16:46 (GMT)
committerRobert Collins <rbtcollins@hp.com>2015-07-29 18:16:46 (GMT)
commitf8d5063645446b73f8c20a29c427cb5711fc629b (patch)
tree6faef36af941ada5a06dfb68cbc251e0400acb16 /Doc
parent991d1d3e4ad085ecf9f3380f0c5ed02eb930b99f (diff)
parentbd4dd54737db2394305745a9cc70981a7ba9eccf (diff)
downloadcpython-f8d5063645446b73f8c20a29c427cb5711fc629b.zip
cpython-f8d5063645446b73f8c20a29c427cb5711fc629b.tar.gz
cpython-f8d5063645446b73f8c20a29c427cb5711fc629b.tar.bz2
Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/faq/programming.rst6
1 files changed, 2 insertions, 4 deletions
diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst
index 1a71c47..2d3cb1c 100644
--- a/Doc/faq/programming.rst
+++ b/Doc/faq/programming.rst
@@ -187,10 +187,8 @@ What are the rules for local and global variables in Python?
------------------------------------------------------------
In Python, variables that are only referenced inside a function are implicitly
-global. If a variable is assigned a new value anywhere within the function's
-body, it's assumed to be a local. If a variable is ever assigned a new value
-inside the function, the variable is implicitly local, and you need to
-explicitly declare it as 'global'.
+global. If a variable is assigned a value anywhere within the function's body,
+it's assumed to be a local unless explicitly declared as global.
Though a bit surprising at first, a moment's consideration explains this. On
one hand, requiring :keyword:`global` for assigned variables provides a bar