microsoft / pyright

Static Type Checker for Python
Other
13.13k stars 1.4k forks source link

Stdlib typeshed stubs should take precedence over `site-packages` #8099

Closed erictraut closed 3 months ago

erictraut commented 3 months ago

See this discussion for details. This is a proposed change to the typing spec (and the original PEP 561) so type checkers better reflect the runtime behavior of import resolution. Note that mypy already implements this behavior, which is technically not conformant with the typing spec as it's written today.

erictraut commented 3 months ago

@debonte, @rchiodo, @heejaechang — I think that language server features (e.g. import completions) will automatically reflect the change I'm making here, but I wanted to bring this to your attention in case there's pylance-specific code that is impacted.

erictraut commented 3 months ago

This is addressed in pyright 1.1.367.