danielgtaylor / danielgtaylor/python-betterproto

Simplify the generated code by explicitly removing dataclasses decorator

Aperta
#334 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
enhancement medium
Lingua principale
Python
Stelle
1.8k
Fork
234
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.