Skip to content

import resolving issue around namespace package. #2358

@heejaechang

Description

@heejaechang

Describe the bug
Pyright shows an unresolvable import squiggles involving namespace package, but if F5, it runs fine.

To Reproduce
repo code is here
https://github.com/microsoft/pyright/blob/main/packages/pyright-internal/src/tests/fourslash/completions.importSubmodule.fourslash.ts

Expected behavior
"setup" not showing squiggles for "from submodule.setup import ... "

Screenshots or Code
image

VS Code extension or command-line
vs code extension

Additional context
it looks like due to extra path, submodule.setup is considered not resolvable even if it is considered resolvable from project root (where test.py file is). and one (extra path) that contains __ init __ wins over and show squiggles. but if run test.py, it works fine by python interpreter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    as designedNot a bug, working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions