]> granicus.if.org Git - python/commitdiff
Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
authorRobert Collins <rbtcollins@hp.com>
Wed, 29 Jul 2015 18:14:32 +0000 (06:14 +1200)
committerRobert Collins <rbtcollins@hp.com>
Wed, 29 Jul 2015 18:14:32 +0000 (06:14 +1200)
Doc/faq/programming.rst
Misc/NEWS

index 1a71c47cb83c666d7362c593cc20751c6695b521..2d3cb1ca052335a864b84bc9bc259493bf9de119 100644 (file)
@@ -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
index 86267577bd733c7429a15fef205099cecb27c241..66b8554bdef557de6a8c86756dd99d043fa97ff7 100644 (file)
--- 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.