github microsoft/pyright 1.1.297
Published 1.1.297

latest releases: 1.1.369, 1.1.368, 1.1.367...
16 months ago

Enhancement: Extended logic that searches for site-packages directory within a venv to handle the case where multiple /lib/python3.X/site-packages are present. The new logic prefers the configured Python version rather than picking the first one returned by the file system.

Enhancement: Added support for bidirectional type inference for dictionary expressions with dictionary expansion entries.

Bug Fix: Fixed a bug that led to a false positive error when using the | operator with two dicts whose keys or values are defined as literals.

Bug Fix: Fixed a recent regression that resulted in an incorrect type evaluation when using a __new__ method whose return type annotation is Self.

Enhancement: Implemented missing check for generic type alias specialization when too few type arguments are provided.

Bug Fix: Fixed a bug that resulted in a false negative when defining a generic class that derives from another generic class and the type parameter isn't compatible with the variance of the base class.

Bug Fix: Added logic to detect when a type alias is used in a generic class declaration's base class list and a type parameter used with the type alias is incompatible with the variance required for the type alias.

Bug Fix (contribution by Michael Davis): Declare workspaceFolders support in LSP server capabilities.

Performance: Performance optimization: reduced formatting of error messages in cases where it can be determined that they are not needed (e.g. in speculative evaluation code paths).

Bug Fix: Fixed a bug that caused the variance for type parameters to be incorrectly inferred when an auto-variance class derived from a non-auto-variance class.

Enhancement: Added support for type guard patterns type(x) == T and type(x) != T.

Enhancement: Improved error handling for dictionary expressions that use bidirectional type inference when the key type doesn't match the expected type.

Enhancement: Improved handling of typing.TypeAlias so it can be aliased and re-exported from other files.

Bug Fix: If no files are found and no errors are detected but the --outputjson command-line option is used, a json report should still be issued.

Bug Fix: Made JSON parsing stricter for the pyrightconfig.json file. Previously, a JSON syntax error was not detected or reported.

Enhancement: Removed the need for the binder to understand typing.Required and typing.NotRequired special forms. This allows these forms to be imported, re-exported, and aliased.

Bug Fix: Fixed a bug that resulted in an incorrect reporting of "unreachable code" after a call to a generator function that contains an unreachable yield statement.

Performance: Fixed performance issue that affected long if/elif chains.

Bug Fix: Fixed bug that resulted in incorrect type evaluation of arguments to functools.partial call along with false positive errors. The problem is that the special-case logic for functools.partial was not applying bidirectional type inference when evaluating the arg type.

Behavior Change: Changed import modeling behavior for import statements with multi-part module names. The statement import a.b.c now implies import a; import a.b; import a.b.c. This also affects import cycle detection because these implicit imports are now part of the import graph.

Bug Fix: Fixed a bug that led to a false positive error when using a subclass of type as a base class in a class declaration.

Behavior Change: Changed reportSelfClsParameterName check to accept mcs and mcls for first parameter in an instance method within a metaclass (i.e. a subclass of type).

Bug Fix: Fixed bug that resulted in the incorrect type evaluation for a function or method that returns Union[*Ts] where Ts is a TypeVarTuple bound to *tuple[()].

Bug Fix: Fixed regression in --verifytypes where variables assigned from calls to TypeVar, ParamSpec, TypeVarTuple, NewType, TypedDict, and NamedTuple were marked as ambiguous.

Enhancement: Added an error message for Concatenate if a TypeVarTuple is used in the concatenated list of types.

Bug Fix: Fixed a bug whereby the signature help and hover text for an overloaded method would adopt its class docstring rather than the docstring for its own implementation.

Enhancement: Added check and corresponding error for use of an unpacked tuple in a Concatenate.

Bug Fix: Fixed several bugs relating to types of callables (functions, methods, lambdas). There were bugs in the type printer, call expression evaluator, and param spec specialization logic.

Enhancement: Added experimental support for inlined TypedDict definitions using the dict[{'a': int}] syntax.

Don't miss a new pyright release

NewReleases is sending notifications on new releases.