Strange inspection result

Reduced version of the offending source:

import sys

def main(a,b,c):

    ...

if __name__ == '__main__':

    main(sys.argv[1], sys.argv[2], sys.argv[3])

The code inspectort shows the same problem with that three times:

Class 'list' does not define '__getitem__',      so the '[]' operator cannot be used on its instances

It is referring to the use of indices on sys.argv.

That's strange! Let's try again, run Code|Inspect Code|Whole Project. No code problems shown. Try again - shows the same problem but on a compaletely different list (local variable called mappings, in a different file). Run it 4th. 5th time it again finds the problem at mappings, not sys.argv.

Evaluatiing PyCharm 110.303 on a Mac which has OS X version 10.5.8

1 comment
Comment actions Permalink

Hi Alan,

There is issue in our tracker looks similar to the problem you described -- http://youtrack.jetbrains.net/issue/PY-5016 . Feel free to vote to get notifications about a progress.

0

Please sign in to leave a comment.