Allow DataHolder to have initial values
This commit is contained in:
parent
33286629b5
commit
e9eea0f3ea
@ -51,6 +51,12 @@ class BaseLoraxClass(object):
|
|||||||
|
|
||||||
class DataHolder(dict):
|
class DataHolder(dict):
|
||||||
|
|
||||||
|
def __init__(self, **kwargs):
|
||||||
|
dict.__init__(self)
|
||||||
|
|
||||||
|
for attr, value in kwargs.items():
|
||||||
|
self[attr] = value
|
||||||
|
|
||||||
def __getattr__(self, attr):
|
def __getattr__(self, attr):
|
||||||
return self[attr]
|
return self[attr]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user