Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Handle relative imports in stubs #574

Closed
MikhailArkhipov opened this issue Jan 31, 2019 · 0 comments · Fixed by #546
Closed

Handle relative imports in stubs #574

MikhailArkhipov opened this issue Jan 31, 2019 · 0 comments · Fixed by #546
Assignees
Labels
bug Something isn't working feature: imports
Milestone

Comments

@MikhailArkhipov
Copy link

MikhailArkhipov commented Jan 31, 2019

Since typeshed root is not in the path resolver snapshot, os stub is unable to resolve path submodule since it uses

from . import path as path

This causes

import os
os.path.

not to show any completions. Works in 3.x.

Also, for stubs it may be worth resolving stub module first and then real module if the stub is missing. I.e. if A is a stub, import B should resolve to a stub for B and only if stub for B is not found, resolve to real B. This should improve performance of the analysis.

Test: OsPathMembers, Python 2.7

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working feature: imports
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants