Skip to content

Instantly share code, notes, and snippets.

@oertels
Created October 2, 2014 06:30
Show Gist options
  • Save oertels/6065c983c8a9d2f1905f to your computer and use it in GitHub Desktop.
Save oertels/6065c983c8a9d2f1905f to your computer and use it in GitHub Desktop.
@typecheck
def foo(bar:int) -> int:
return bar * 2
>>> foo(3)
6
>>> foo('bar')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.3/dist-packages/typecheck/typecheck_decorator.py", line 332, in typecheck_invocation_proxy
str(arg) == "" and "''" or arg))
typecheck.typecheck_decorator.InputParameterError: foo() has got an incompatible value for bar: bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment