Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #377: No return value expeced 🐛 #378

Merged
merged 1 commit into from
Jul 6, 2021
Merged

Conversation

g-paras
Copy link
Contributor

@g-paras g-paras commented Jul 6, 2021

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

@@ -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.
  • mypy Passed
  • pytest doctest Passed

@faif faif merged commit 24c6cc8 into faif:master Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants