Prevent `@dataclass` from being called twice on the same class
Open
@ericvsmith is already working on this.
Since May 3, 2022.
3.11
stdlib
topic-dataclasses
type-feature
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- PR merge metrics
- PR metrics pending
Description
Currently it's possible to do this:
@dataclass(repr=False)
@dataclass(repr=True)
class C:
pass
This is confusing at best, and will produce unexpected classes at worst.
With this change, that will become an error.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.