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

Class BoxWithProperty

test/test_box.py:1724–1741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1722
1723 def test_box_property_support(self):
1724 class BoxWithProperty(Box):
1725 def __init__(self, *args, **kwargs):
1726 super().__init__(*args, **kwargs)
1727
1728 @property
1729 def field(self):
1730 return self._field
1731
1732 @field.setter
1733 def field(self, value):
1734 self._field = value
1735
1736 @field.deleter
1737 def field(self):
1738 """
1739 This is required to make `del box.field` work properly otherwise a `BoxKeyError` would be thrown.
1740 """
1741 del self._field
1742
1743 box = BoxWithProperty()
1744 box.field = 5

Callers 1

Calls

no outgoing calls

Tested by 1