@property inheritance the right way
Parent class with
Child can inherit and overload the property while accessing
Parent property getter and setter.
Although we could just reimplement the
Child.value property logic completely without using
Parent.value whatsover, this would violate the DRY principle and, more important, it wouldn't allow for proper multiple inheritance (as show in the example
valueproperty completely, both getter and setter.
Parent.valueproperty, and only overloads setter.
Parentclass must be referenced explicitly.
In either pattern, using
Parent.value.getter is as simple as
Parent.property.setter is more verbose:
super(Child, type(self)).value.fset(self, new_value)
It would be nice to just
super().value = new_value but this won't work due to
super current implementation (as Python 3.7).
There is a Python Issue regarding this rather unintuitive behaviour.