Skip to content

Ensure Uniqueness for Recursive Generic types #172

Open
@rnag

Description

@rnag

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions