Browse Source

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

pull/9921/head
Robert Collins 11 years ago
parent
commit
f8d5063645
  1. 6
      Doc/faq/programming.rst
  2. 5
      Misc/NEWS

6
Doc/faq/programming.rst

@ -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

5
Misc/NEWS

@ -23,6 +23,11 @@ Library
- Issue #17527: Add PATCH to wsgiref.validator. Patch from Luca Sbardella.
Documentation
-------------
- Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
What's New in Python 3.5.0 beta 4?
==================================

Loading…
Cancel
Save