MCPcopy Create free account
hub / github.com/cdgriffith/Box / BoxWithProperty

Class BoxWithProperty

test/test_box.py:1789–1806  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

Calls

no outgoing calls

Tested by 1