Skip to content

Instantly share code, notes, and snippets.

@nulltier
Created February 11, 2013 20:35
Show Gist options
  • Save nulltier/4757380 to your computer and use it in GitHub Desktop.
Save nulltier/4757380 to your computer and use it in GitHub Desktop.
Annotations in python3
def bar(x: "широта в градусах"=60):
pass
def foo(x: int, y: int, *args: str) -> int:
pass
bar.__annotations__ # {'x': 'широта в градусах'}
foo.__annotations__ # {'y': <class 'int'>, 'args': <class 'str'>, 'return': <class 'int'>, 'x': <class 'int'>}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment