Skip to content

Ignore dataclass fields with init=False #2

@mthuurne

Description

@mthuurne

See this TODO comment:

TODO: Ignore fields with init=False.

It is possible for a dataclass field to define init=False, which means that field cannot be initialized via the __init__() method. This is a problem for the binder, as it passes all parsed fields to __init__().

The use case for init=False offered by the standard library documentation is to mark fields initialized via __post_init__(). This use case would be satisfied by simply having the binder ignore all fields with init=False.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions