-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Clarifying nonlocal doc: SyntaxError is raised if nearest enclosing scope is global #114009
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
Merged
JelleZijlstra
merged 11 commits into
python:main
from
quazi-irfan:nonlocal_global_executionmodel_doc_update
Apr 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c908a9e
Nonload and global doc update executionmodel.rst
quazi-irfan 8041c18
Remove trailing white space
quazi-irfan bb12728
Revert old change
quazi-irfan b5d88f1
Add missing article
quazi-irfan 069c096
Move lines to top and minor changed to improve readability
quazi-irfan 99129a7
Fix global keyword link
quazi-irfan 4e4d7f8
Revert change to line position
quazi-irfan df409c1
Reverted i.e.
quazi-irfan 1c6e8bd
Remove global keyword link
quazi-irfan e88927c
Update Doc/reference/executionmodel.rst
JelleZijlstra b678fec
Remove global link
quazi-irfan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Move lines to top and minor changed to improve readability
- Loading branch information
commit 069c0963513b135e45c84ffdb6c2ae6015ab4733
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull
2F11
request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing "i.e." makes this wrong: the global namespace is the same as the module namespace here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I am implying here. The next part of the sentence is written in the same way.
"the builtins namespace, the namespace of the module builtins" implying the builtins namespace and the namespace of the module builtins are the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see; I don't think that is clear on reading the sentence.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this version of the sentence?
"Names are resolved in the top-level namespace by searching the global namespace which is the namespace of the module containing the code block, and the builtins namespace which is the namespace of the module builtins."
Doc also uses the word "module namespace" frequently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works though I'd put commas before "which". I think the existing wording is fine though, so I'd prefer to keep it.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted it.
I think, both of us needing a secondary clarification is a sign that this sentence could be written better.