|I get a false positive on my __init__() method claiming I have not called the __init__() method of a base class, when I do so on the very first line of my method.
I did not encounter this problem in pylint 0.23.0. I upgraded to pylint 0.25.0, and now I do get it.
I have reduced it to the smallest program that repros the bug:
# Problem doesn't occur if class is not nested in function.
# Problem doesn't occur if import is not nested in function.
from threading import Thread
def __init__(self): # False positive W0231 on this line.
junk = NestedThread()
This code doesn't do anything meaningful, but the idiom of nested imports/classes comes up from unit-tests embedded in the same file as the interface they are testing. The regular clients shouldn't trigger the import or class declaration.