-
Notifications
You must be signed in to change notification settings - Fork 216
Closed
astral-sh/ruff
#18404Labels
genericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementationhelp wantedContributions especially welcomeContributions especially welcome
Description
ty currently only has partial support for legacy aliases such as Dict, List, FrozenSet, etc. For example, these two reveal_type calls should both reveal dict[str, int], but the second one does not:
from typing import Dict
def f(x: dict[str, int], y: Dict[str, int]):
reveal_type(x) # revealed: dict[str, int]
reveal_type(y) # revealed: dict[Unknown, Unknown]We now support generics, so this should be fairly easy to fix. We need to resolve the TODOs in this area of the code: https://github.com/astral-sh/ruff/blob/ad2f667ee4323dd0c12224338734d722d13d28b4/crates/ty_python_semantic/src/types/infer.rs#L8753-L8789
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
genericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementationhelp wantedContributions especially welcomeContributions especially welcome