Silence PyLint warning about unused variables for string interpolation

Yes, you can silence pylint warnings.

Here is one way:

import say

def f(a):
    # pylint: disable=unused-argument
    return say.fmt("The value of 'a' is {a}")

Alternatively, you can create a config file and add these lines to it:

[MESSAGES CONTROL]
disable=unused-argument

Reference:

  • https://pylint.readthedocs.io/en/latest/faq.html#is-it-possible-to-locally-disable-a-particular-message
  • https://pylint.readthedocs.io/en/latest/user_guide/run.html#command-line-options

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)