faif / python-patterns

A collection of design patterns/idioms in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No return value expected

g-paras opened this issue · comments

def clone(self, **attrs: Any) -> None:
"""Clone a prototype and update inner attributes dictionary"""
# Python in Practice, Mark Summerfield
# copy.deepcopy can be used instead of next line.
obj = self.__class__(**self.__dict__)
obj.__dict__.update(attrs)
return obj

According to type hint None type should be returned but obj of type Prototype is returned.

You are right, that was introduced in a12ad8e#diff-292e21ea71bfaa9c4ecf149a183f5080c973cf7b22bb080b7b520e5875476c0dR29. Feel free to submit a fix