dataclass-wizard icon indicating copy to clipboard operation
dataclass-wizard copied to clipboard

Strict Mode for "Strict" Equivalence of Literals (type)

Open rnag opened this issue 11 months ago • 0 comments

As per: Equivalence of two Literals

Two types Literal[v1] and Literal[v2] are equivalent when both of the following conditions are true: type(v1) == type(v2) v1 == v2

I would like to update deserialization for typing.Literal in v1 opt-in to account for this.

Perhaps a Meta setting strict_mode_for_literals: bool, or else more simply a strict: bool, can be added to support this feature / enhancement.

rnag avatar Dec 29 '24 01:12 rnag