Skip to content

Instantly share code, notes, and snippets.

@davehewy
Last active February 17, 2016 13:37
Show Gist options
  • Save davehewy/b20863645621e066c125 to your computer and use it in GitHub Desktop.
Save davehewy/b20863645621e066c125 to your computer and use it in GitHub Desktop.
inheritance pythom
class Base:
templates = {}
def register(self, register):
self.templates.update(register)
def do_something():
for tpl in self.templates.values():
print "Perhaps access the object here? I.e"
# I don't really like this, which led me to question it.
instance = self.templates[tpl]()
class ExtensionOne(Base)
def __init__():
TropoBuilder = TropoBuild()
TropoBuilder.register({'Nat': Nat})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment