[Python-checkins] cpython (3.4): Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
robert.collins
python-checkins at python.org
Wed Jul 29 20:20:36 CEST 2015
https://hg.python.org/cpython/rev/941b9c27b8c8
changeset: 97128:941b9c27b8c8
branch: 3.4
parent: 97124:3caa68f55e3e
user: Robert Collins <rbtcollins at hp.com>
date: Thu Jul 30 06:14:32 2015 +1200
summary:
Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
files:
Doc/faq/programming.rst | 6 ++----
Misc/NEWS | 2 ++
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst
--- a/Doc/faq/programming.rst
+++ b/Doc/faq/programming.rst
@@ -187,10 +187,8 @@
------------------------------------------------------------
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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -396,6 +396,8 @@
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.
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list