| 77 | |
| 78 | print("Example 5") |
| 79 | class ImmutablePoint: |
| 80 | def __init__(self, name, x, y): |
| 81 | self.__dict__.update(name=name, x=x, y=y) |
| 82 | |
| 83 | def __setattr__(self, key, value): |
| 84 | raise AttributeError("Immutable object: set not allowed") |
| 85 | |
| 86 | def __delattr__(self, key): |
| 87 | raise AttributeError("Immutable object: del not allowed") |
| 88 | |
| 89 | |
| 90 | # Verify del is also prevented |
no outgoing calls
no test coverage detected