Why does type checking not work in Python 3?
I have done the following code with type checks or hints:
import typing
def hello(message: str):
pr
Python 3 doesn't have the kind of type checking you're looking for.
def hello(message: str):
This is a function annotation.
https://www.python.org/dev/peps/pep-3107/
All it does is associate a bit of extra data with the function object. This can be inspected later on the func_annotations attribute of the function.
It has no built-in behavior beyond this. The intent is for third-parties to build behavior on top of this.