| 1787 | |
| 1788 | def test_box_property_support(self): |
| 1789 | class BoxWithProperty(Box): |
| 1790 | def __init__(self, *args, **kwargs): |
| 1791 | super().__init__(*args, **kwargs) |
| 1792 | |
| 1793 | @property |
| 1794 | def field(self): |
| 1795 | return self._field |
| 1796 | |
| 1797 | @field.setter |
| 1798 | def field(self, value): |
| 1799 | self._field = value |
| 1800 | |
| 1801 | @field.deleter |
| 1802 | def field(self): |
| 1803 | """ |
| 1804 | This is required to make `del box.field` work properly otherwise a `BoxKeyError` would be thrown. |
| 1805 | """ |
| 1806 | del self._field |
| 1807 | |
| 1808 | box = BoxWithProperty() |
| 1809 | box.field = 5 |
no outgoing calls