ty icon indicating copy to clipboard operation
ty copied to clipboard

Do not expand PEP-613 type aliases on hover

Open hamdanal opened this issue 1 month ago • 2 comments

They could become unwieldy especially for large unions. See these two examples

Image Where the tuple is defined using a type alias in the stub and Image Where the type of `value` is defines as `Scalar | ListLikeU | None` in pandas-stubs.

In both cases displaying the name of the type alias would make the signature more readable.

hamdanal avatar Dec 14 '25 13:12 hamdanal

To implement this, we would need to represent PEP-613 aliases as first-class opaque types in our model, similar to what we do with PEP-695 aliases. (That's definitely something we could do, but it's quite different to our current implementation.)

AlexWaygood avatar Dec 14 '25 13:12 AlexWaygood

I think this would pretty much require the refactor to split type-expression inference more fully from value-expression inference.

carljm avatar Dec 15 '25 19:12 carljm