-
Notifications
You must be signed in to change notification settings - Fork 23
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
Detect unused TypeVar
s
#83
Conversation
pyi.py
Outdated
# Mapping of all private TypeVars/ParamSpecs/TypeVarTuples to the nodes where they're defined | ||
typevarlike_defs: dict[TypeVarInfo, ast.Assign] = field(default_factory=dict) | ||
# Mapping of each name in the file to the no. of occurences | ||
all_name_occurences: Counter[str] = field(default_factory=Counter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all_name_occurences: Counter[str] = field(default_factory=Counter) | |
all_name_occurrences: Counter[str] = field(default_factory=Counter) |
This needs to be changed in a few other places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh good catch
A few false positives in the typeshed output which I need to sort out. |
Looks like we need to unconditionally call generic_visit in visit_BinOp. |
Yeah, I'm on it. |
This doesn't look right to me, because |
Yup, that worked -- thanks! |
python/typeshed#6928 gets rid of the unused |
I'll extend this to cover unused type aliases in another PR. |
No description provided.