Python: unused argument needed for compatibility. How to avoid Pylint complaining about it

I do not believe disabling some pylint warnings is bad style, as long as it is done carefully with clear intent and as specific as possible. For this purpose it is important to activate the useless-suppression check. When it is active pylint will warn you if some messages are locally disabled for no good reason. Add this to your .pylintrc:

[MESSAGES CONTROL]
enable=useless-suppression

For example I would recommend disabling the exact occurrence of the issue like in the following example:

def my_function(
        used,
        unused=False,  # pylint: disable=unused-argument
):
    """ Function with unused argument. """
    return used

Adding a leading underscore should also keep pylint from triggering:

def my_function(used, _unused=False):
    """ Function with unused argument. """
    return used

Another commonly used pattern is the following:

def my_function(used, unused_a, unused_b=False):
    """ Function with unused argument. """
    _ = (unused_a, unused_b,)
    return used