PyCQA/pycodestyle

Fails to detect `E713 test for membership should be 'not in'` when left side more complex than simple variable

Kache opened this issue · 1 comments

var = {'foo': 3}

if not var in [1, 2, 3]:  # detected
    pass

# all the below are not detected

if not var['foo'] in [1, 2, 3]:
    pass

if not str(var) in [1, 2, 3]:
    pass

if not var.keys() in [1, 2, 3]:
    pass

edit

sorry, dupe of #334

please search the issue tracker next time. I've put in a bunch of work to make it easy to search by code