I have installed Pyright for type-checking my Python code, but I am not sure how to run it. For example, this is the code I have
def add(x: int, y: int):
return x + y
print(add(10, 20))
When I try to run it with python
, python typed.py
, it gives me the following errors:
File "typed.py", line 2
def add(x: int, y: int):
^
SyntaxError: invalid syntax
I have run through the doc, but I have found no option for compiling or running the code. How can I run these typed Python code?