[issue12165] [doc] clarify documentation of nonlocal

2022-02-24 Thread Eryk Sun
Eryk Sun added the comment: > Another problem with the current text is that it fails to exclude > enclosing class scopes The nonlocal statement is only disallowed in module code (i.e. "exec" compilation mode) because it can never be nested. It's allowed in a class definition that has an

[issue12165] [doc] clarify documentation of nonlocal

2022-02-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I think this is more confusing then helpful. I concur. -- ___ Python tracker ___ ___

[issue12165] [doc] clarify documentation of nonlocal

2022-02-24 Thread Stanley
Change by Stanley : -- keywords: +patch nosy: +slateny nosy_count: 6.0 -> 7.0 pull_requests: +29672 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31551 ___ Python tracker

[issue12165] [doc] clarify documentation of nonlocal

2021-12-12 Thread Irit Katriel
Irit Katriel added the comment: The doc has been updated by now and mentions "excluding globals". I'm changing the title to reflect Terry's last comment. One comment on his suggestion: I would remove/change "the nonlocal statement is similar to the global statement" because it's not obvious