Closed g-paras closed 3 years ago
I have used class name with quotes as return type because we can not use class name before its definition.
1 file changed .\patterns\creational\prototype.py
.\patterns\creational\prototype.py
@@ -29,7 +29,7 @@ def __init__(self, value: str = "default", **attrs: Any) -> None: self.value = value self.__dict__.update(attrs) - def clone(self, **attrs: Any) -> None: + def clone(self, **attrs: Any) -> "Prototype": """Clone a prototype and update inner attributes dictionary""" # Python in Practice, Mark Summerfield # copy.deepcopy can be used instead of next line.
I have used class name with quotes as return type because we can not use class name before its definition.
1 file changed
.\patterns\creational\prototype.py