nac3-spec/toy-impl/examples/a.py

15 lines
261 B
Python

I = TypeVar('I', int32, int64)
class Vec:
v: list[int32]
def __init__(self, v: list[int32]):
self.v = v
def __add__(self, other: int32) -> Vec:
return Vec([v + other for v in self.v])
def addI(a: I, b: I) -> I:
return a + b