diff options
author | Stanley <46876382+slateny@users.noreply.github.com> | 2022-12-22 23:23:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-22 23:23:25 (GMT) |
commit | f3db68e6e66ebb36e1b9cb30daba913ecc736169 (patch) | |
tree | debc66ef6ac33cedade8bbd6c157b4bd3c886e62 /Doc/reference | |
parent | ad23da0e77c4c4a3185df64d1c199b8c17e08188 (diff) | |
download | cpython-f3db68e6e66ebb36e1b9cb30daba913ecc736169.zip cpython-f3db68e6e66ebb36e1b9cb30daba913ecc736169.tar.gz cpython-f3db68e6e66ebb36e1b9cb30daba913ecc736169.tar.bz2 |
gh-48496: Added example and link to faq for UnboundLocalError in reference (#93068)
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/executionmodel.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Doc/reference/executionmodel.rst b/Doc/reference/executionmodel.rst index 3f01180..a264015 100644 --- a/Doc/reference/executionmodel.rst +++ b/Doc/reference/executionmodel.rst @@ -128,6 +128,8 @@ lead to errors when a name is used within a block before it is bound. This rule is subtle. Python lacks declarations and allows name binding operations to occur anywhere within a code block. The local variables of a code block can be determined by scanning the entire text of the block for name binding operations. +See :ref:`the FAQ entry on UnboundLocalError <faq-unboundlocalerror>` +for examples. If the :keyword:`global` statement occurs within a block, all uses of the names specified in the statement refer to the bindings of those names in the top-level |