Property getter/setter
Section: Inheritance and protocols
Property getter/setter
python
python
class Celsius:
def __init__(self, value: float):
self._value = value
@property
def value(self) -> float:
return self._value
@value.setter
def value(self, new_value: float):
self._value = new_valueLearn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Inheritance and protocols