This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: "4.6. Defining Functions" should mention nonlocal
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Mariatta, docs@python, miss-islington, pbhd0815, rhettinger
Priority: normal Keywords: easy, patch

Created on 2019-04-27 04:24 by pbhd0815, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 12983 merged pbhd0815, 2019-04-27 13:44
PR 13644 merged miss-islington, 2019-05-29 03:40
Messages (6)
msg340963 - (view) Author: Peter Bauer (pbhd0815) * Date: 2019-04-27 04:24
In the fourth paragraph, the sentence 

"Thus, global variables cannot be directly assigned a value within a function (unless named in a global statement)"

should somehow be extended to mention the nonlocal-statements:

Thus, global variables or variables of enclosing functions cannot be directly assigned a value within a function (unless named in a global statement (for global variables) or named in a nonlocal statement (for variables of enclosing functions)
msg340964 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-04-27 04:35
Thanks for the suggestion.  Would you like to submit a PR?
msg340984 - (view) Author: Peter Bauer (pbhd0815) * Date: 2019-04-27 13:04
ok, will try to create a pull-request for that, although i'm not a natural englishman...
msg343861 - (view) Author: miss-islington (miss-islington) Date: 2019-05-29 03:38
New changeset e1f95e77e0647aff602e0660ba3c282b71045875 by Miss Islington (bot) (pbhd) in branch 'master':
bpo-36739: Update controlflow.rst (GH-12983)
https://github.com/python/cpython/commit/e1f95e77e0647aff602e0660ba3c282b71045875
msg343862 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2019-05-29 03:41
Thanks!
msg343863 - (view) Author: miss-islington (miss-islington) Date: 2019-05-29 03:48
New changeset cee95fe1825dfeb52d7074c8209b5884a079f06c by Miss Islington (bot) in branch '3.7':
bpo-36739: Update controlflow.rst (GH-12983)
https://github.com/python/cpython/commit/cee95fe1825dfeb52d7074c8209b5884a079f06c
History
Date User Action Args
2022-04-11 14:59:14adminsetgithub: 80920
2019-05-29 03:48:16miss-islingtonsetmessages: + msg343863
2019-05-29 03:41:04Mariattasetstatus: open -> closed

nosy: + Mariatta
messages: + msg343862

resolution: fixed
stage: patch review -> resolved
2019-05-29 03:40:23miss-islingtonsetpull_requests: + pull_request13540
2019-05-29 03:38:09miss-islingtonsetnosy: + miss-islington
messages: + msg343861
2019-04-27 13:44:34pbhd0815setkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request12908
2019-04-27 13:04:22pbhd0815setmessages: + msg340984
2019-04-27 04:35:33rhettingersetnosy: + rhettinger
messages: + msg340964

keywords: + easy
stage: needs patch
2019-04-27 04:24:09pbhd0815create