-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redundant sentence in FAQ #67777
Comments
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. |
How about: In Python, variables that are only referenced inside a function are implicitly |
Updated diff as Raymond's wording. |
I think the first sentence could be improved, even though it's correct. |
What about changing the first sentence to: In Python, variables that are only referenced but not assigned inside a function are implicitly global.? |
Or: In Python, variables inside a function that are only referenced but not assigned are implicitly global.? |
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. |
@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. |
New changeset 02f3bf3f74aa by Robert Collins in branch '2.7': New changeset 941b9c27b8c8 by Robert Collins in branch '3.4': New changeset 93f3ca8fdc39 by Robert Collins in branch '3.5': New changeset 7163dd7e9511 by Robert Collins in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: