summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-07-29 18:20:21 (GMT)
committerRobert Collins <rbtcollins@hp.com>2015-07-29 18:20:21 (GMT)
commit8ed48182896729baf063e8bae349fc7f40917f08 (patch)
treeac761e5e27f4f6751214f6fbbe620dbe96c99df0
parente625e7c793d6fbbc07ddb94e7eaacda15c49ca99 (diff)
parentf8d5063645446b73f8c20a29c427cb5711fc629b (diff)
downloadcpython-8ed48182896729baf063e8bae349fc7f40917f08.zip
cpython-8ed48182896729baf063e8bae349fc7f40917f08.tar.gz
cpython-8ed48182896729baf063e8bae349fc7f40917f08.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/NEWS5
2 files changed, 7 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
diff --git a/Misc/NEWS b/Misc/NEWS
index ba287d4..59f6af8 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -46,6 +46,11 @@ Library
- Issue #13248: Remove deprecated inspect.getargspec and inspect.getmoduleinfo
functions.
+Documentation
+-------------
+
+- Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
+
What's New in Python 3.5.0 beta 4?
==================================