You are looking at function annotations. They are not specific to property
objects. Annotations let you attach arbitrary information to a function; the -> [expression]
part gives information about the return value of the function. The syntax was added in Python 3.0.
In Python 3.5, a standard for adding type hinting was added to the language library, which uses function annotations to attach type information objects to the arguments and return value of functions.
You can always look at the Python reference documentation to search for specific syntax, the Full Grammar Specification should help you find the funcdef
rule that contains the ->
syntax, and a search of the documentation then points to the Function definitions section:
Parameters may have annotations of the form “: expression
” following the parameter name. Any parameter may have an annotation even those of the form *identifier
or **identifier
. Functions may have “return” annotation of the form “-> expression
” after the parameter list. These annotations can be any valid Python expression and are evaluated when the function definition is executed.
See PEP 3107 – Function annotations for the syntax proposal, and PEP 484 – Type Hints for information on how to use these when adding type hints.