github microsoft/pyright 1.1.376
Published 1.1.376

latest releases: 1.1.381, 1.1.380, 1.1.379...
one month ago

Bug Fixes:

  • Fixed bug that results in a crash when an empty tuple is used to specialize a generic type alias parameterized by a ParamSpec.
  • Fixed a bug that results in a false positive reportInconsistentOverload error when the implementation of the overload includes a decorator that changes the type of the implementation to a non-function type.
  • Fixed bug that results in a false positive error when type argument for Literal doesn't follow type expression rules within a value expression context.
  • Fixed regression that resulted in a hang when determining whether an overload implementation with generics was compatible with its overloads.
  • Fixed bug that results in a false negative reportIncompatibleMethodOverride when the child class method uses a type parameter that is scoped to the child class.
  • Fixed bug that produces signatures with extra (unnecessary) positional-only and keyword-only separators when using a TypedDict with zero fields.
  • Improved consistency of parameter name restrictions for the reportSelfClsParameterName check. Previously, different rules were applied to __new__ and class methods within metaclasses.
  • Fixed a false positive error when solving type variables in a call that involves a lambda.
  • Fixed bug that results in a confusing type in an error message when isinstance type narrowing between a type and another type creates a subclass.
  • Fixed bug that leads to false positive error when a protocol has a read-only property a class has a Final variable.
  • Fixed bug that leads to a hang under certain circumstances involving deeply-nested higher-order functions.
  • Fixed bug that results in a confusing type in an error message when isinstance type narrowing between a type and another type creates a subclass.

Enhancements:

  • Enhanced argument-to-parameter matching logic to support dictionary unpacking where the dict key type is a union of literals.

Behavior Changes:

  • Changed composition of settings that affect type checking behaviors. Previously, some LSP settings that affect type checking could override config files. Now, the config file always "wins". Command-line parameters passed to the CLI version of pyright win over both LSP settings and config files.
  • Changed synthesized comparison methods (__lt__, etc.) for dataclasses when order=True to use Self rather than an instance of the class. This is not only more consistent with other synthesized methods, but it also preserves covariance of type variables if the dataclass is frozen.
  • Changed behavior for protocols that have methods with method-scoped type variables. These are no longer treated as free type variables during protocol matching, so they can be used to support rank-2 polymorphism. This behavior is not currently dictated by the typing spec, but it is more consistent with mypy.

Don't miss a new pyright release

NewReleases is sending notifications on new releases.