MCPcopy
hub / github.com/tornadoweb/tornado / ObjectDict

Class ObjectDict

tornado/util.py:55–65  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

53
54
55class ObjectDict(Dict[str, Any]):
56 """Makes a dictionary behave like an object, with attribute-style access."""
57
58 def __getattr__(self, name: str) -> Any:
59 try:
60 return self[name]
61 except KeyError:
62 raise AttributeError(name)
63
64 def __setattr__(self, name: str, value: Any) -> None:
65 self[name] = value
66
67
68class GzipDecompressor:

Callers 4

__init__Method · 0.90
generateMethod · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by 2

__init__Method · 0.72