Makes a dictionary behave like an object, with attribute-style access.
| 24 | |
| 25 | |
| 26 | class ObjectDict(dict): |
| 27 | """Makes a dictionary behave like an object, with attribute-style access. |
| 28 | """ |
| 29 | |
| 30 | def __getattr__(self, key): |
| 31 | if key in self: |
| 32 | return self[key] |
| 33 | return None |
| 34 | |
| 35 | def __setattr__(self, key, value): |
| 36 | self[key] = value |
| 37 | |
| 38 | |
| 39 | class WeChatSigner(object): |
no outgoing calls
searching dependent graphs…