Last active
February 17, 2016 13:37
-
-
Save davehewy/b20863645621e066c125 to your computer and use it in GitHub Desktop.
inheritance pythom
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 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