Search code examples
pythonpylint

Change black listed functions in PyLint


I can disable the following warning completely:

W0141: Used builtin function %r Used when a black listed builtin function is used (see the bad-function option). Usual black listed functions are the ones like map, or filter , where Python offers now some cleaner alternative like list comprehension.

But is there also a way to remove one function from the black list?


Solution

  • You can generate a rc file for pylint. (See pylint doc how to do this)

    Within that you'll find something like this:

    bad-functions=map,filter,apply,input
    

    There you can simply remove the annoying function. If you're using Eclispe go afterwards to PyLint's preferences and add --rcfile=path\to\your_rc_file in the arguments for pylint input box.