I want the Python interpreter to yell at me if I override an abstract property method, but forget to specify that it's still a property method in the child class.
class Parent(metaclass=ABCMeta):
@property
@abstractmethod
def name(self) -> str:
pass
class Child(Parent):
@property # If I forget this, I want Python to yell at me.
def name(self) -> str:
return 'The Name'
if __name__ == '__main__':
print(Child().name)
Is there really no built-in way for Python to do this? Must I really create my own decorator to handle this type of behavior?