Open
Description
We need to allow writing generic functions (templates) and template constraints.
One idea that we can explore is to also support something like: #152 (comment):
>>> def str(val: i32 | f64):
... # "isinstance" type guard
... if isinstance(val, i32):
... # type of `val` is narrowed to `i32`
... return str_int(val)
... elif isinstance(val, f64):
... # else, type of `val` is narrowed to `f64`
... return str_float(val)
Metadata
Metadata
Assignees
Labels
No labels