5.3. IntrospectionΒΆ
def annotated(x: int, y: str) -> bool:
return x < y
print(annotated.__annotations__)
# {'y': <class 'str'>, 'return': <class 'bool'>, 'x': <class 'int'>}
def annotated(x: int, y: str) -> bool:
return x < y
print(annotated.__annotations__)
# {'y': <class 'str'>, 'return': <class 'bool'>, 'x': <class 'int'>}