Skip to content

Consider making DataclassLike non-final #16

@NeilGirdhar

Description

@NeilGirdhar

I want to derive a protocol from DataclassLike:

@runtime_checkable
class TDataclassInstance(DataclassLike, Protocol):
    static_fields: ClassVar[list[str]]
    dynamic_fields: ClassVar[list[str]]

This is for the return value of a dataclass_transform-marked constructor.


Another option would be to make final protocols support being inherited by other protocols, i.e., final only blocks non-protocol class inheritance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions