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

Method __getattr__

example_code/item_061.py:55–58  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

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

__getattr__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected