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.
1 parent 9fb7488 commit 54fd9f8Copy full SHA for 54fd9f8
Lib/annotationlib.py
@@ -1050,6 +1050,9 @@ def _get_dunder_annotations(obj):
1050
1051
Does not return a fresh dictionary.
1052
"""
1053
+ # This special case is needed to support types defined under
1054
+ # from __future__ import annotations, where accessing the __annotations__
1055
+ # attribute directly might return annotations for the wrong class.
1056
if isinstance(obj, type):
1057
try:
1058
ann = _BASE_GET_ANNOTATIONS(obj)
0 commit comments