Skip to content

incompatible typevar-likes with same name #86

@jorenham

Description

@jorenham

e.g.

type A[T: str] = T | bool
type B[T: int] = T | bool

currently raises

NotImplementedError: conflicting typevar definitions: 'T'

instead, it should result in something like

from typing import TypeAlias, TypeVar

_T1 = TypeVar("_T1", bound=str)
_T2 = TypeVar("_T2", bound=int)

A: TypeAlias = _T1 | bool
B: TypeAlias = _T2 | bool

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions