Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incompatible typevar-likes with same name #86

Open
jorenham opened this issue Oct 2, 2024 · 0 comments
Open

incompatible typevar-likes with same name #86

jorenham opened this issue Oct 2, 2024 · 0 comments

Comments

@jorenham
Copy link
Owner

jorenham commented Oct 2, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant