File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,8 @@ Yes. The coding style required for standard library modules is documented as
113113Core Language
114114=============
115115
116+ .. _faq-unboundlocalerror :
117+
116118Why am I getting an UnboundLocalError when the variable has a value?
117119--------------------------------------------------------------------
118120
Original file line number Diff line number Diff line change @@ -128,6 +128,8 @@ lead to errors when a name is used within a block before it is bound. This rule
128128is subtle. Python lacks declarations and allows name binding operations to
129129occur anywhere within a code block. The local variables of a code block can be
130130determined by scanning the entire text of the block for name binding operations.
131+ See :ref: `the FAQ entry on UnboundLocalError <faq-unboundlocalerror >`
132+ for examples.
131133
132134If the :keyword: `global ` statement occurs within a block, all uses of the names
133135specified in the statement refer to the bindings of those names in the top-level
You can’t perform that action at this time.
0 commit comments