| 108 | print("Example 5") |
| 109 | try: |
| 110 | class MissingPropertyRecord: |
| 111 | def __getattr__(self, name): |
| 112 | if name == "bad_name": |
| 113 | raise AttributeError(f"{name} is missing") |
| 114 | value = f"Value for {name}" |
| 115 | setattr(self, name, value) |
| 116 | return value |
| 117 | |
| 118 | data = MissingPropertyRecord() |
| 119 | assert data.foo == "Value for foo" # Test this works |