typeannotations icon indicating copy to clipboard operation
typeannotations copied to clipboard

Is set of types supported?

Open yakovkeselman opened this issue 8 years ago • 1 comments

This is really a question, not an issue: is there a way to implement a type-annotated function that takes arguments of different but compatible types, such as "int" and "float"? I was thinking of the set syntax, such as:

@typechecked def f(x: {int, float}): return x*2

Thank you!

yakovkeselman avatar Feb 05 '17 05:02 yakovkeselman

Hi! this project is not maintained anymore. For a better alternative, look at the MyPy project: http://mypy-lang.org/

ceronman avatar Feb 11 '17 11:02 ceronman