I create module in another module (it is important it is not top level module) with same name as module from standard library, for example "string.py":
# string.py
ascii_letters = 'abc'
In the same directory I create module which import the module and use it in invalid way:
import string
def f():
print string.ascii_letters
print string.ascii_lowercase # it is invalid and marked as invalid
When I import function f a call it, there is error - and pydev marks it as error what is ok
abc
Traceback (most recent call last):
File "...", line 5, in <module>
print string.ascii_lowercase
But when I used future statement absolute_import it is ok, top level modules have higher priority than modules in the same directory:
from __future__ import absolute_import
import string
def f():
print string.ascii_letters
print string.ascii_lowercase # it is ok but marked as invalid
When I import function f a call it, it is ok but pydev marks it as error:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
just encountered the same problem. hope this will be fixed quite soon.