Normally in Python, one should use an _
to indicate an argument is unused.
def example_basic(unused):
pass
becomes
def example_basic(_):
pass
Then if there are multiple unused arguments, multiple _
s can't be used since they will conflict, so a *_
is used:
def example_multiple(unused1, unused2):
pass
becomes
def example_multiple(*_):
pass
Finally, what should be done if there are multiple non-adjacent arguments that go unused?
def example_non_adjacent(unused1, used, unused2):
return used
Using multiple _
s still does not work, and using *_
won't work since they're non-adjacent.
Note that I would very much prefer to change the API, but for the sake of this question let's assume that's not possible. Is there a way to indicate it's ignored without using something like # pylint: disable=unused-argument
for PyLint or i-dont-know-what for PyCharm?
EDIT:
I posted an example where this is needed here