]> 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 588066dbc5e275e3e30dd9e443c8e6e86ab41cfa..23891be14f90cd378848f14ae546e2224468e977 100644 (file)
@@ -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
index 65bb83796172391d31755f0fbdef19d08f0d62e3..9979c69bfa591df658e56caf502df6cb46a4d8a0 100644 (file)
--- 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.