Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f8d5063

Browse files
committed
Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
2 parents 991d1d3 + bd4dd54 commit f8d5063

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

Doc/faq/programming.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,8 @@ What are the rules for local and global variables in Python?
187187
------------------------------------------------------------
188188

189189
In Python, variables that are only referenced inside a function are implicitly
190-
global. If a variable is assigned a new value anywhere within the function's
191-
body, it's assumed to be a local. If a variable is ever assigned a new value
192-
inside the function, the variable is implicitly local, and you need to
193-
explicitly declare it as 'global'.
190+
global. If a variable is assigned a value anywhere within the function's body,
191+
it's assumed to be a local unless explicitly declared as global.
194192

195193
Though a bit surprising at first, a moment's consideration explains this. On
196194
one hand, requiring :keyword:`global` for assigned variables provides a bar

Misc/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ Library
2323

2424
- Issue #17527: Add PATCH to wsgiref.validator. Patch from Luca Sbardella.
2525

26+
Documentation
27+
-------------
28+
29+
- Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
30+
2631

2732
What's New in Python 3.5.0 beta 4?
2833
==================================

0 commit comments

Comments
 (0)