They are type hints in python. Basically, you hint the type of the object(s) you're using. Type-hints are for maintainability and don't get interpreted by Python. So, you might say that a variable has type float whereas python will internally interpret as int only. Eg -
my_var:float = 4
print(type(my_var))
OUTPUT :
<class 'int'>
In your case, it doesn't make much sense. But to ease maintainability when your projects grow large, it is helpful. These can be considered as the next step from # type comments. Eg-
-
my_var = 4.2 # type: float
-
my_var: float = 4.2
The above two codes can be considered to be similar in their functionalities.
You can read more about it here - https://docs.python.org/3/library/typing.html
More on this - What are type hints in Python 3.5?