-
Notifications
You must be signed in to change notification settings - Fork 148
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
vulture does not detect code usage by case
clauses in pattern matching
#276
Comments
Thanks for the report! We haven't added explicit support for the But in your code, I think |
Nope. It is used. The syntax decided for pattern matching is a bit counterintuitive. In this example: case MyClass(my_test=True): is more or less equivalent to: if is_instance(x, MyClass):
if x.my_test == True: I also had to get used to this. It seems like you're making a new |
Thanks for the explanation! Yes, then probably Vulture could be changed so that this case is detected. |
Hi,
I'm running into a issue with pattern matching and vulture. In my case the property of a class is only used during pattern matching. Vulture doesn't pick up on it and considers it dead code. I've whitelisted the properties for now, but it would be great if vulture could be improved to cover this new scenario.
Pseudo code example:
In this example, vulture seems to flag
my_test
as dead code.The text was updated successfully, but these errors were encountered: