8000 Check that `@typeclass` functions do not have body · Issue #241 · dry-python/classes · GitHub
[go: up one dir, main page]

Skip to content

Check that @typeclass functions do not have body #241

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

Closed
sobolevn opened this issue Jun 25, 2021 · 0 comments · Fixed by #245
Closed

Check that @typeclass functions do not have body #241

sobolevn opened this issue Jun 25, 2021 · 0 comments · Fixed by #245
Labels
enhancement New feature or request

Comments

@sobolevn
Copy link
Member

When defining a typeclass, it is easy to forget that @typeclass definition must not have a body.

Probably, we can check it with mypy.

So, this must be an error:

@typeclass
def some(instance) -> None:
    x = 1
@sobolevn sobolevn added the enhancement New feature or request label Jun 25, 2021
sobolevn added a commit that referenced this issue Jul 3, 2021
sobolevn added a commit that referenced this issue Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

1 participant
0