MCPcopy Create free account
hub / github.com/EasyIME/PIME / ObjectDict

Class ObjectDict

python/python3/tornado/util.py:72–82  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

70
71
72class ObjectDict(Dict[str, Any]):
73 """Makes a dictionary behave like an object, with attribute-style access."""
74
75 def __getattr__(self, name: str) -> Any:
76 try:
77 return self[name]
78 except KeyError:
79 raise AttributeError(name)
80
81 def __setattr__(self, name: str, value: Any) -> None:
82 self[name] = value
83
84
85class GzipDecompressor(object):

Callers 4

__init__Method · 0.90
generateMethod · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by 2

__init__Method · 0.72