Fix nested Annotated calls not resolving

This commit is contained in:
Rapptz committed 2022-08-17 10:41:57 -04:00
1 parent 8dd186cf1e
commit 1c7747fe9d
7 files changed
+70 -18

No files matched your search

+5
View File
@@ -1062,6 +1062,11 @@ def evaluate_annotation(
cache[tp] = evaluated
return evaluated
if hasattr(tp, '__metadata__'):
# Annotated[X, Y] can access Y via __metadata__
metadata = tp.__metadata__[0]
return evaluate_annotation(metadata, globals, locals, cache)
if hasattr(tp, '__args__'):
implicit_str = True
is_literal = False