changeset: 97127:02f3bf3f74aa branch: 2.7 parent: 97123:12b353f76447 user: Robert Collins date: Thu Jul 30 06:14:32 2015 +1200 files: Doc/faq/programming.rst Misc/NEWS description: Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan. diff -r 12b353f76447 -r 02f3bf3f74aa Doc/faq/programming.rst --- a/Doc/faq/programming.rst Wed Jul 29 14:40:27 2015 +0200 +++ b/Doc/faq/programming.rst Thu Jul 30 06:14:32 2015 +1200 @@ -333,10 +333,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 -r 12b353f76447 -r 02f3bf3f74aa Misc/NEWS --- a/Misc/NEWS Wed Jul 29 14:40:27 2015 +0200 +++ b/Misc/NEWS Thu Jul 30 06:14:32 2015 +1200 @@ -136,6 +136,8 @@ 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.