Skip to content

Add classd snippet for creating a dataclass #15

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

Merged
merged 3 commits into from
Oct 13, 2021

Conversation

macintacos
Copy link
Contributor

This adds the classd snippet, which creates a class definition using the @dataclass decorator, adds the necessary import statement, and provides a sample property for the user to fill in.

User can remove the import statement (or have their editor do it for them). I'm on the fence about leaving the import statement in, as folks new to Python might define multiple classes within the same file and have multiple import statements, but presumably they'll have a linter setup to save them. Up to you though.

@cstrap cstrap merged commit 1bcff7a into cstrap:master Oct 13, 2021
@cstrap
Copy link
Owner

cstrap commented Oct 13, 2021

Thanks!

@macintacos macintacos deleted the dataclass branch October 15, 2021 05:03
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