MCPcopy
hub / github.com/wechatpy/wechatpy / ObjectDict

Class ObjectDict

wechatpy/utils.py:26–36  ·  view source on GitHub ↗

Makes a dictionary behave like an object, with attribute-style access.

Source from the content-addressed store, hash-verified

24
25
26class 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
39class WeChatSigner(object):

Callers 3

__get__Method · 0.90
__init__Method · 0.90
test_object_dictMethod · 0.90

Calls

no outgoing calls

Tested by 1

test_object_dictMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…