You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Nope. It is used. The syntax decided for pattern matching is a bit counterintuitive.
In this example:
caseMyClass(my_test=True):
is more or less equivalent to:
ifis_instance(x, MyClass):
ifx.my_test==True:
I also had to get used to this. It seems like you're making a new MyClass object to compare against, but it works a bit differently. Helpful intro here, in case you're curious.
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: