How to write differently to remove this type hint in Python 2.7?

Shaozhong SHI shishaozhong at gmail.com
Wed Oct 21 17:24:28 EDT 2020


Is there another way to do this?

def greet(name: str) -> str:
    return "Hello, " + name
greet

File "<ipython-input-28-bee2cddf1f0d>", line 1 def greet(name: str) -> str:
^ SyntaxError: invalid syntax


More information about the Python-list mailing list