Skip to content

Instantly share code, notes, and snippets.

@dguaraglia
Created June 22, 2018 17:54
Show Gist options
  • Save dguaraglia/6a71a4350d3df9ea07f95cb90c36e7f8 to your computer and use it in GitHub Desktop.
Save dguaraglia/6a71a4350d3df9ea07f95cb90c36e7f8 to your computer and use it in GitHub Desktop.
class Backend(object):
def do_something(self):
raise NotImplemented()
class EtcdBackend(Backend):
def do_something(self):
... # do some actual work
def call_backend(backend):
backend.do_something() # <- will blow up if you accidentally pass a "Backend" that didn't re-implement do_something()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment