summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-07-30 06:14:32 +1200
committerRobert Collins <rbtcollins@hp.com>2015-07-30 06:14:32 +1200
commitbd4dd54737db2394305745a9cc70981a7ba9eccf (patch)
tree62cae674b245d6e87ff26592c986c9b1a8bcb4fa
parent111803c0389ff5c68da377dd3c27e30a68c3e2f0 (diff)
downloadcpython-git-bd4dd54737db2394305745a9cc70981a7ba9eccf.tar.gz
Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
-rw-r--r--Doc/faq/programming.rst6
-rw-r--r--Misc/NEWS2
2 files changed, 4 insertions, 4 deletions
diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst
index 1a71c47cb8..2d3cb1ca05 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
diff --git a/Misc/NEWS b/Misc/NEWS
index 86267577bd..66b8554bde 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -396,6 +396,8 @@ C API
Documentation
-------------
+- Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
+
- Issue #24351: Clarify what is meant by "identifier" in the context of
string.Template instances.