5

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

bad_coder
  • 8,684
  • 19
  • 37
  • 59
Alfred Huang
  • 16,537
  • 32
  • 111
  • 185

1 Answers1

1

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!

Alfred Huang
  • 16,537
  • 32
  • 111
  • 185