Introduction, Code Formatting And Tools
Annotations
Section titled βAnnotationsβThe basic idea of them is to hint to the readers of the code about what to expect as values of arguments in functions.
@dataclassclass Point lat: float long: float
def locate(latitude: float, longitude: float) -> Point: """Find an object in the map by its coordinates"""
locate.__annotations_# {'latitude': <class 'float'>, 'longitude': <class 'float'>, '