Why is bar blacklisted in pylint


I have an error while linting my django project with pylint.
Pylint shows an error while linting my django project “C0102: Black listed name “bar” (blacklisted-name)”

It’s correct that I have a function called bar, but why is this name blacklisted?
I don’t know of a built-in with that name.

Asked By: Frank



PyLint has a default list of names that shouldn’t be used for variables: foo, bar, baz, toto, tutu, and tata. I think the reason that bar is on this list is that it’s often used along with foo and baz as a “jokey” name for a variable in example or throwaway code.

The list of blacklisted names is changeable via the bad-names option. You can also find more information on disabling certain checks at these links:

Answered By: jjramsey

My typical pylint command line has 70 instances of the -d (ignore check) option.

Answered By: Wilder Bill
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.