Hello, one question.
I have an abstract class like this:
from abc import ABCMeta, abstractmethod
from copy import deepcopy
class BookPrototype(metaclass=ABCMeta):
@property
def title(self):
pass
@title.setter
@abstractmethod
def title(self, val):
pass
@abstractmethod
def clone(self):
pass
Another class implements the setter and the clone methods:
class ScienceFiction(BookPrototype):
def title(self, val):
self.title = val
def __init__(self):
pass
def clone(self):
return deepcopy(self)
The docs states I should decorate the title in the concrete class with: @BookPrototype.title.setter
but when I add it, I get the following error:
TypeError: 'NoneType' object is not callable
If I remove it, the code (apparently) works.
What am I doing wrong?