File tree 2 files changed +4
-0
lines changed
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
113
113
Core Language
114
114
=============
115
115
116
+ .. _faq-unboundlocalerror :
117
+
116
118
Why am I getting an UnboundLocalError when the variable has a value?
117
119
--------------------------------------------------------------------
118
120
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
128
128
is subtle. Python lacks declarations and allows name binding operations to
129
129
occur anywhere within a code block. The local variables of a code block can be
130
130
determined 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.
131
133
132
134
If the :keyword: `global ` statement occurs within a block, all uses of the names
133
135
specified 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