The new Typescript seems absolutely delicious!
… Python 3 now has argument and function annotation expressions.
Imagine annotations like:
def func(x: int, y: Thing) -> float:
both self-documenting and checkable!
I imagine you could override the built-in
int function and so on such that
__or__ and such work:
def get(i: int or string) -> object or None:
(Although I haven’t explored how that would affect
I have my own Python JSON validation expressed as Python code already, which is equivalent to the declaration of duck-typing objects parameters; I’ll publish it as a stand-alone post soon.
There is active work on Python static typing too, which can be useful if a library arrives that lets you examine functions. Imagine a light-table or Python text editor that did optional and inferred static typing as you typed…
↓ click the "like" button to share on twitter and facebook!