Skip to content

Simplify the generated code by explicitly removing dataclasses decorator #334

Open
@Gobot1234

Description

@Gobot1234

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmediumMedium effort issue, can fit in a single PR

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions