summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-07-29 18:14:32 (GMT)
committerRobert Collins <rbtcollins@hp.com>2015-07-29 18:14:32 (GMT)
commitf524799a652fc9086ad61537906d02702fb18280 (patch)
tree602947c58db4bfb4921c42fe14f314482086107b
parent15a92fde7d648441e79503e51ac1a0e4d9661938 (diff)
downloadcpython-f524799a652fc9086ad61537906d02702fb18280.zip
cpython-f524799a652fc9086ad61537906d02702fb18280.tar.gz
cpython-f524799a652fc9086ad61537906d02702fb18280.tar.bz2
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 588066d..23891be 100644
--- a/Doc/faq/programming.rst
+++ b/Doc/faq/programming.rst
@@ -333,10 +333,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 65bb837..9979c69 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -136,6 +136,8 @@ IDLE
Documentation
-------------
+- Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
+
- Issue #22155: Add File Handlers subsection with createfilehandler to Tkinter
doc. Remove obsolete example from FAQ. Patch by Martin Panter.