python-betterproto
python-betterproto copied to clipboard
Simplify the generated code by explicitly removing dataclasses decorator
If PEP 681 is accepted we would be able to simplify the generated code by removing the dataclasses decorator and then implictly make betterproto.Messages be dataclasses by defining __init_subclass__ and retain the typed constructor:
def __init_subclass__(cls) -> None:
dataclasses.dataclass(eq=False, repr=False)(cls)
I think this would be a nice readabilty improvement.
Small update https://mail.python.org/archives/list/[email protected]/thread/JWMSWJ6JZJNNG3JKPBYDMQUUHZFD2FZL, this will probably have to wait for b6
PEP 681 has now been accepted so this should be ok to implement