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

Provide decorators as an alternative to magic methods #142

Open
MatthieuDartiailh opened this issue Nov 25, 2021 · 0 comments
Open

Provide decorators as an alternative to magic methods #142

MatthieuDartiailh opened this issue Nov 25, 2021 · 0 comments

Comments

@MatthieuDartiailh
Copy link
Member

Following the addition of support for typing in the last release, I think that adding the following decorators would help since the decorators will provide type hints when it comes to the expected signature of the method. Additionally it will allow more easily to share the same handler across several members by accepting several names. Using a decorator also make the intent very clear and will allow the metaclass to raise rather than simply warn (see #139 ) if the member does not exist.

  • default
  • post_setattr
  • post_getattr
  • validate
  • post_validate
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

No branches or pull requests

1 participant