The root of the problem however is that PythonPathCache often contains
relative qualified names as keys. It leads to the situation where
QFrame module is resolved to the corresponding files both in PyQt and
PySide. We should probably either omit such resolve result in
PythonPathCache entirely or use absolute qualified names for them as
keys.
The problem was caused by the fact that we ignore imported element
"request" in "flask/__init__.py" at first and mark this module as
already checked (using the name "flask") and then refuse to suggest
"flask.globals.requests" because its canonical qualified name is
"flask.request".
I've also added a test on importing functions of os.path module since
it's a well-known case where several different symbols should be imported
using the same name (provided by PyStdlibCanonicalPathProvider).
My first attempt to fix the problem by saving actual import candidates
instead of their canonical qualified names has broken exactly this
scenario.