mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
This commit is contained in:
parent
111803c038
commit
bd4dd54737
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue