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

Class LazyRecord

example_code/item_061.py:51–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50print("Example 1")
51class LazyRecord:
52 def __init__(self):
53 self.exists = 5
54
55 def __getattr__(self, name):
56 value = f"Value for {name}"
57 setattr(self, name, value)
58 return value
59
60
61print("Example 2")

Callers 1

item_061.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected