Created
June 22, 2018 17:54
-
-
Save dguaraglia/6a71a4350d3df9ea07f95cb90c36e7f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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