October 2018
Beginner to intermediate
736 pages
17h 39m
English
The bulk of the properties of BaseDataObject are Boolean values, flags that indicate whether an instance of the class is in a specific state. The implementations of those properties all follow a simple pattern that's already been shown in the definition of the available property of BaseProduct in the previous iteration. That structure looks like this:
################################### # Property-getter methods # ################################### def _get_bool_prop(self) -> (bool,): return self._bool_prop ################################### # Property-setter methods # ################################### def _set_bool_prop(self, value:(bool,int)): if value not in (True, False, 1, 0): raise ValueError( '%s.bool_prop ...