Skip to content

Instantly share code, notes, and snippets.

@diminoten
Created February 20, 2014 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save diminoten/9122638 to your computer and use it in GitHub Desktop.
Save diminoten/9122638 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):
@staticmethod
def get_latest():
#Can I refer to Foo in some way other than directly like this?
return Foo._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