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

Auto apply dataclass decorator to subclasses #30

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

erogol
Copy link
Member

@erogol erogol commented Feb 16, 2022

Addressing #25

@erogol erogol requested a review from reuben February 16, 2022 10:40
@@ -578,6 +578,9 @@ class Coqpit(Serializable, MutableMapping):

_initialized = False

def __init_subclass__(cls, **kwargs):
return dataclass(_cls=cls, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the class already has the annotation? Otherwise LGTM.

@erogol
Copy link
Member Author

erogol commented Feb 16, 2022

I tried but failed. Giving up for now.

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