on-internet
← Community

Should you decorate dataclass subclasses if not making additional fields

Stack Overflow ·

If you don't add any more fields to your subclass is there a need to add the @dataclass decorator to it and would it do anything? If there is no difference, which is the usual convention? from dataclasses import dataclass @dataclass class AAA: x: str y: str ... # decorate? class BBB(AAA): ...

Comments

Sign in or sign up to comment and upvote.

No comments yet.