Robert Collins added the comment:
@Demian, I agree that there are more improvements we can make. The current
patch addresses the specific issue of this bug, and if you wished to make a new
issue with further improvements that would be great. I'm going to apply this
patch now though.
Changes by Robert Collins robe...@robertcollins.net:
--
resolution: - fixed
stage: commit review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23589
___
Roundup Robot added the comment:
New changeset 02f3bf3f74aa by Robert Collins in branch '2.7':
Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
https://hg.python.org/cpython/rev/02f3bf3f74aa
New changeset 941b9c27b8c8 by Robert Collins in branch '3.4':
Issue #23589:
Demian Brecht added the comment:
Not to throw a wrench into this, but would it perhaps not be worthwhile to
refactor this section in order to include nonlocals as well (obviously not for
2.7)? It seems a little odd to me to have this amount of detail without
mentioning nonlocal.
--
Yongzhi Pan added the comment:
Or:
In Python, variables inside a function that are only referenced but not
assigned are implicitly global.?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23589
Yongzhi Pan added the comment:
What about changing the first sentence to:
In Python, variables that are only referenced but not assigned inside a
function are implicitly global.?
--
___
Python tracker rep...@bugs.python.org
New submission from Yongzhi Pan:
In
https://docs.python.org/3/faq/programming.html#what-are-the-rules-for-local-and-global-variables-in-python,
two sentences of essentially the same meaning exist. I try to remove this
redundancy.
--
assignee: docs@python
components: Documentation
Yongzhi Pan added the comment:
Updated diff as Raymond's wording.
--
Added file: http://bugs.python.org/file38340/faq_fix_1.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23589
___
Ezio Melotti added the comment:
I think the first sentence could be improved, even though it's correct.
A superficial reading might give the impression that function variables are
implicitly global, or that only the variables inside a function are global,
especially if the reader is not
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
assignee: docs@python - ezio.melotti
nosy: +ezio.melotti
stage: - commit review
versions: +Python 2.7 -Python 3.2, Python 3.3
___
Python tracker rep...@bugs.python.org
Raymond Hettinger added the comment:
How about:
In Python, variables that are only referenced inside a function are implicitly
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.
--
nosy:
11 matches
Mail list logo