Skip to content

Allow omitting initializer for Final attributes in dataclasses #5608

Description

@ilevkivskyi

Dataclasses typically don't have __init__, so this is rejected, but is probably valid:

@dataclass
class C:
    x: int
    y: Final[int]

A possible solution is that plugin should set the final_set_in_init flag manually for the corresponding field Vars.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions