From e4197c3c2b08215121c6d7246e56d436ede7c30b Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Fri, 10 Nov 2023 18:28:46 -0800 Subject: [PATCH] Updated import resolution documentation to cover a case that was previously not mentioned in the docs. This addresses #6415. --- docs/import-resolution.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/import-resolution.md b/docs/import-resolution.md index 0e1741ce4..72e3aaf83 100644 --- a/docs/import-resolution.md +++ b/docs/import-resolution.md @@ -26,6 +26,7 @@ For absolute (non-relative) imports, Pyright employs the following resolution or 5. Try to resolve using a **third-party typeshed** stub. If the `typeshedPath` is configured, use this instead of the typeshed stubs that are packaged with Pyright. This allows for the use of a newer or a patched version of the typeshed third-party stubs. +6. For an absolute import, if all of the above attempts fail, attempt to import a module from the same directory as the importing file and parent directories that are also children of the root workspace. This accommodates cases where it is assumed that a Python script will be executed from one of these subdirectories rather than from the root directory. ### Configuring Your Python Environment