Open
Description
def my_func(x):
if x:
pass
else:
# pylint: disable=protected-access
return x._foo
The disable has no effect here and a warning is generated. If any statement is insert between the else and the disable then it works properly. I suspect the line numbering for the else portion of the ast starts at the first child of the else clause rather than the else keyword itself.