We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ForwardRef
1 parent 95d6e0b commit 70decdaCopy full SHA for 70decda
Lib/annotationlib.py
@@ -167,6 +167,13 @@ def evaluate(
167
globals[param.__name__] = param
168
if self.__extra_names__:
169
locals = {**locals, **self.__extra_names__}
170
+ if (annotate := getattr(owner, "__annotate__", None)) and annotate.__closure__:
171
+ for name, cell in zip(annotate.__code__.co_freevars, annotate.__closure__):
172
+ if name != "__classdict__":
173
+ try:
174
+ locals[name] = cell.cell_contents
175
+ except ValueError:
176
+ pass
177
178
arg = self.__forward_arg__
179
if arg.isidentifier() and not keyword.iskeyword(arg):
0 commit comments