Python property with public getter and private setter
Python has no privacy model. Using underscores is only a convention, there is no access control.
If you don't want the 'public' API to include a sett, then just remove the setter from your class and assign to self._persistentMaxInputs.value
in your class code directly. You can make it a function if you want to limit the number of locations that need to remember this:
def _setMaxInputs(self, value):
self._persistentMaxInputs.value = value
You can of course make that a separate property
object, but then you'd have to forgo the decorator syntax:
def _maxInputs(self, value):
self._persistentMaxInputs.value = value
_maxInputs = property(None, _maxInputs)
but now at least you can use self._maxInputs = value
in your class code. This doesn't really offer that much of a syntax improvement however.