Skip to content

Instantly share code, notes, and snippets.

@habnabit
Forked from diminoten/gist:9122638
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save habnabit/9122666 to your computer and use it in GitHub Desktop.
Save habnabit/9122666 to your computer and use it in GitHub Desktop.
class Foo():
@classmethod
def _fetch(cls, data):
response = requests.get("http://example.com/my/fun/data", data=data)
return cls(response.json())
class ChildFoo(Foo):
@classmethod
def get_latest(cls):
return cls._fetch({'fleeb':'farb', 'can':'dog'})
def __init__(self, config_params):
self.some = config_params['some']
self.flip = config_params['flip']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment