2 ms·
Note that you can query the annotations during runtime: In [1]: a: int In [2]: b = 5 In [3]: c: int = 8 In [4]: __annotations__ Out[4]: {'a': int, 'c': int
by dveeden2 7y ago
Note that you can query the annotations during runtime:
In [1]: a: int
In [2]: b = 5
In [3]: c: int = 8
In [4]: __annotations__
Out[4]: {'a': int, 'c': int}
In [5]: c = 'foo'
In [6]: __annotations__
Out[6]: {'a': int, 'c': int}
Tinkering with __annotations__ is also needed for hy (python lisp(-like?) language, http://hylang.org/ http://hylang.org/)
Did anyone try this with things that interface with Fortran or C?