In Python, we all know Type hints, which became available from 2015:
def greet(name: str) -> str:
return "Hello, " + name
and we also know Function Annotations, in particular here I am referring to textual annotations like:
def greet(name: "The name of the person to greet") -> str:
return "Hello, " + name
But is it possible to use Type Hints together with a textual function annotation?
For example:
def greet(name: str, "The name of the person to greet") -> str:
return "Hello, " + name
This last one throws an error.
I cannot seem to find any source in PEP or Python docs about whether this would be possible or not. Although I haven't searched particularly deeply, I still would appreciate a source on potential answers.