Init
im going to bed -=-
This commit is contained in:
16
lib/invoke/vendor/lexicon/attribute_dict.py
vendored
Normal file
16
lib/invoke/vendor/lexicon/attribute_dict.py
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
class AttributeDict(dict):
|
||||
def __getattr__(self, key):
|
||||
try:
|
||||
return self[key]
|
||||
except KeyError:
|
||||
# to conform with __getattr__ spec
|
||||
raise AttributeError(key)
|
||||
|
||||
def __setattr__(self, key, value):
|
||||
self[key] = value
|
||||
|
||||
def __delattr__(self, key):
|
||||
del self[key]
|
||||
|
||||
def __dir__(self):
|
||||
return dir(type(self)) + list(self.keys())
|
||||
Reference in New Issue
Block a user