Re:Type hinting for Python
by willvarfar on Tuesday January 06, 2015 @01:41PM
(#8846157)
Apologies to everyone tired of hearing about it, but an alternative non-standard syntax is my own obiwan https://pypi.python.org/pypi/obiwan
[ Parent
| on HN ]
There's also https://github.com/prechelt/typecheck-decorator
...which I prefer stylistically (decorators instead of magic monkey-patching).
My contribution is https://github.com/kislyuk/ensure
It's fast and doesn't monkey-patch things.
Re:Type hinting for Python
by mosquito_hater on Wednesday January 07, 2015 @08:27PM
(#8854517)
@ensure_annotations
def f(x: int, y: float) -> float:
return x+y
This looks great, I wish it was the standardCool, I like this. I think I prefer your reuse of the collection literal syntax to the syntax in Guido's proposal.
There's also https://github.com/prechelt/typecheck-decorator
...which I prefer stylistically (decorators instead of magic monkey-patching).
There's also https://github.com/prechelt/typecheck-decorator
...which I prefer stylistically (decorators instead of magic monkey-patching).
There's also https://github.com/prechelt/typecheck-decorator
...which I prefer stylistically (decorators instead of magic monkey-patching).