-
-
Save romank0/babbfad3be21b93ad010 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Parent(object): | |
conf = {} | |
def __init__(self, *args, **kwargs): | |
type(self).conf = defaultdict( | |
None, **super(type(self), self).conf) | |
super(Parent, self).__init__(*args, **kwargs) | |
@classmethod | |
def set_param(cls, name, value): | |
cls.conf[name] = value | |
class Child(Parent): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment