Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm 3.4.1: Unresolved reference 'map'

Tags:

python

pycharm

As we know, map is a Python built-in function.

I use PyCharm 3.4.1 currently, and it reports an

Unresolved reference 'map'

in my code:

a = map(int, [1,2,3])

where the map word was with red waved underscore, and shows this tip of message.

enter image description here

I've been reading about the question: PyCharm shows unresolved references error for valid code

And did File | Invalidate Caches... and restarting PyCharm helps.

But problem still unsolved.


For more info, I'm working on a Django 1.6 object. The project interpreter is as below:

enter image description here

like image 530
Alfred Huang Avatar asked Nov 10 '22 02:11

Alfred Huang


1 Answers

Finally I found the point myself:

Pycharm generates a file builtins.py for code prompt.

It's path is probably under:

C:\Program Files (x86)\JetBrains\PyCharm 3.4.1\helpers\python-skeletons\builtins.py

Randomly choose a built-in function, click it with Ctrl key, then this file is open in PyCharm.

Then I see the error, but still without knowing how and when it happens:

enter image description here

I see the multiline comment block was closed incorrectly.

I manually fixed it, and everything goes well!

like image 90
Alfred Huang Avatar answered Nov 15 '22 12:11

Alfred Huang