Skip to content

Instantly share code, notes, and snippets.

@drewsonne
Last active March 10, 2016 08:47
Show Gist options
  • Save drewsonne/cf5ffbc924f513157d52 to your computer and use it in GitHub Desktop.
Save drewsonne/cf5ffbc924f513157d52 to your computer and use it in GitHub Desktop.
Python Stub files

How to do type hinting in Python2.x. You'll probably need to pip install typing for the typing package.

class Expenses(object):
def load(self):
return self
def run(self):
return self
def _parse_args(self):
return self
import expenses
import typing
class Expenses(object):
def load(self) -> expenses.Ncexpenses: ...
def run(self) -> expenses.Ncexpenses: ...
def _parse_args(self, args: typing.List[str]) -> expenses.Ncexpenses: ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment