Function Annotations
Function annotations are defined in PEP 3107. They allow attaching data to the arguments and return of a function. The behaviour of annotations is not defined by the language - and left to third party frameworks. For example, a library could be written to handle static typing:
def haul(item: Haulable, *vargs: PackAnimal) -> DistanceRead more about this topic: Python Syntax And Semantics
Famous quotes containing the word function:
“If the children and youth of a nation are afforded opportunity to develop their capacities to the fullest, if they are given the knowledge to understand the world and the wisdom to change it, then the prospects for the future are bright. In contrast, a society which neglects its children, however well it may function in other respects, risks eventual disorganization and demise.”
—Urie Bronfenbrenner (b. 1917)