We have builtin dir() function to get all attributes available for class or instance, defined in based classes.
Is there same for annotations? I'd like to have get_annotations() function, which works like this:
def get_annotations(cls: type): ... # ?
class Base1:
foo: float
class Base2:
bar: int
class A(Base1, Base2):
baz: str
assert get_annotations(A) == {'foo': float, 'bar': int, 'baz': str}