Open akhundMurad opened 1 year ago
Hi, can I work on this?
Can't you just add del args
etc. in the method body @akhundMurad ?
@jendrikseipp It will make my code messy. Just imagine that each protocol method will have del
statement in it...
Can you paste the content of the method to get a clearer picture for the use case?
Also, is it possible to change the method signature, i.e., to change msg
to msg_
to signal that the argument is unused?
https://github.com/akhundMurad/diator/blob/main/src/diator/middlewares/logging.py
Here you can see the full code. I added # noqa
comment as a temporary fix.
Thanks! And is it possible to change the method signature, i.e., to change msg
to msg_
to signal that the argument is unused?
The purpose of the Protocol is to define the signature of class and its methods. Therefore, I cannot change the argument name
OK, thanks. Then the best solution would be to detect that this class inherits from Protocol and ignore the unused method arguments. Doing this cleanly will probably require adding scope information to Vulture, see #304. Until then, I don't think it makes sense to tackle this issue.
Got it, thank you!
Suppose I have protocol class:
After execution of vulture I get the following output:
In my opinion, vulture should ignore this type of "confidence", due to the nature of typing.Protocol