I am just wondering how can I use read-only property and set initial values in __init__
I would like to have something like this:
Simply private (as much a python
enables privacy) variable which is set in constructor.
class A:
def __init__(self, value: int):
self.value = value
@property
def value(self):
return self.value
As far I know this is not possible (cannot set the value)?