danielgtaylor / danielgtaylor/python-betterproto
Simplify the generated code by explicitly removing dataclasses decorator
Open
enhancement
medium
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
If [PEP 681](https://www.python.org/dev/peps/pep-0681) is accepted we would be able to simplify the generated code by removing the dataclasses decorator and then implictly make `betterproto.Message`s be dataclasses by defining `__init_subclass__` and retain the typed constructor:
```py
def __init_subclass__(cls) -> None:
dataclasses.dataclass(eq=False, repr=False)(cls)
```
I think this would be a nice readabilty improvement.
Contributor guide
Assessment
This issue has not been assessed yet.