This commit is contained in:
Michael Carlstrom 2024-12-05 20:01:33 -05:00
parent 4d0968dea8
commit e84df95bf2

View File

@ -1105,6 +1105,7 @@ def test_dict_ranges(tested_dict, expected):
# https://docs.python.org/3/howto/annotations.html#accessing-the-annotations-dict-of-an-object-in-python-3-9-and-older
def get_annotations_helper(o):
dir(o)
if isinstance(o, type):
return o.__dict__.get("__annotations__", {})
return getattr(o, "__annotations__", {})