W0621 redefined-outer-name


'Redefining name %r from outer scope (line %s)'


Used when a variable’s name hides a name defined in the outer scope.


Here we define the variable some_name that shadows the function of the same name.

def some_name(): pass

def example():
    some_name = 1
4:4: W0621: Redefining name 'some_name' from outer scope (line 1)

This can lead to very confusing type errors. Most of the time it is also a sign of naming problems.

Running Pylint locally? In your CI?

There is a better way! Run PyCodeQual & get Pylint findings with history, diffs and statistics.

Click here to find out more.