From d5b6abad59ce8c4d9cf87b62d23fed656ef43644 Mon Sep 17 00:00:00 2001 From: JR Heard Date: Fri, 31 May 2024 20:00:30 -0700 Subject: [PATCH] Fix typo in type-stubs.md (#8037) --- docs/type-stubs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/type-stubs.md b/docs/type-stubs.md index 6a9343814..fdd331bd6 100644 --- a/docs/type-stubs.md +++ b/docs/type-stubs.md @@ -4,7 +4,7 @@ Type stubs are “.pyi” files that specify the public interface for a library. ### Importance of Type Stub Files -Regardless of the search path, Pyright always attempts to resolve an import with a type stub (“.pyi”) file before falling back to a python source (“.py”) file. If a type stub cannot be located for an external import, Pyright will try to use inline type information if the module is part of a package that contains a “py.typed” file (defined in [PEP 561](https://www.python.org/dev/peps/pep-0561/)). If the module is part of a package that doesn’t contain a “py.typed” file, Pyright will treat all of the symbols imported from these modules will be of type “Unknown”, and wildcard imports (of the form `from foo import *`) will not populate the module’s namespace with specific symbol names. +Regardless of the search path, Pyright always attempts to resolve an import with a type stub (“.pyi”) file before falling back to a python source (“.py”) file. If a type stub cannot be located for an external import, Pyright will try to use inline type information if the module is part of a package that contains a “py.typed” file (defined in [PEP 561](https://www.python.org/dev/peps/pep-0561/)). If the module is part of a package that doesn’t contain a “py.typed” file, Pyright will treat all of the symbols imported from these modules as having type “Unknown”, and wildcard imports (of the form `from foo import *`) will not populate the module’s namespace with specific symbol names. Why does Pyright not attempt (by default) to determine types from imported python sources? There are several reasons.