Commit f524799a authored by Robert Collins's avatar Robert Collins

Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.

parent 15a92fde
...@@ -333,10 +333,8 @@ What are the rules for local and global variables in Python? ...@@ -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 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 global. If a variable is assigned a value anywhere within the function's body,
body, it's assumed to be a local. If a variable is ever assigned a new value it's assumed to be a local unless explicitly declared as global.
inside the function, the variable is implicitly local, and you need to
explicitly declare it as 'global'.
Though a bit surprising at first, a moment's consideration explains this. On Though a bit surprising at first, a moment's consideration explains this. On
one hand, requiring :keyword:`global` for assigned variables provides a bar one hand, requiring :keyword:`global` for assigned variables provides a bar
......
...@@ -136,6 +136,8 @@ IDLE ...@@ -136,6 +136,8 @@ IDLE
Documentation Documentation
------------- -------------
- Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
- Issue #22155: Add File Handlers subsection with createfilehandler to Tkinter - Issue #22155: Add File Handlers subsection with createfilehandler to Tkinter
doc. Remove obsolete example from FAQ. Patch by Martin Panter. doc. Remove obsolete example from FAQ. Patch by Martin Panter.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment