I have a class with the following implementation:
class Device(AbstractDevice):
@property
def value(self):
return 1
it uses this ABC:
from abc import ABC
from abc import abstractmethod
class AbstractDevice(ABC):
@property
@abstractmethod
def value(self):
pass
@value.setter
@abstractmethod
def value(self):
pass
The problem is, python doesn't seem to enforce the setter part. Am I missing some decorator or is that by design?
What I would like to happen is if a user implements a class using my AbstractDevice
the way I've done here, they'll get an error saying they need to implement the value.setter
. Is that at all possible?