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

Ensure Uniqueness for Recursive Generic types

Open rnag opened this issue 11 months ago • 0 comments

In v1 opt-in, a decorator setup_recursive_safe_function_for_generic() is used to generate code for generic types such as Union and Literal.

However, it uses the type's __args__ to check for recursion.

This works fine currently, because while Union[str, int] is valid, Literal[str, int] is invalid.

As we add support for more generic types, it's conceivable that this might result in clashing and/or unexpected behavior. So creating an issue to address / look into this.

rnag avatar Dec 30 '24 22:12 rnag