Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/invoke/vendor/lexicon/attribute_dict.py: 38%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

13 statements  

1class AttributeDict(dict): 

2 def __getattr__(self, key): 

3 try: 

4 return self[key] 

5 except KeyError: 

6 # to conform with __getattr__ spec 

7 raise AttributeError(key) 

8 

9 def __setattr__(self, key, value): 

10 self[key] = value 

11 

12 def __delattr__(self, key): 

13 del self[key] 

14 

15 def __dir__(self): 

16 return dir(type(self)) + list(self.keys())