MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / LoggingLazyRecord

Class LoggingLazyRecord

example_code/item_061.py:69–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67
68print("Example 3")
69class LoggingLazyRecord(LazyRecord):
70 def __getattr__(self, name):
71 print(
72 f"* Called __getattr__({name!r}), "
73 f"populating instance dictionary"
74 )
75 result = super().__getattr__(name)
76 print(f"* Returning {result!r}")
77 return result
78
79data = LoggingLazyRecord()
80print("exists: ", data.exists)

Callers 1

item_061.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected