github microsoft/pyright 1.1.381
Published 1.1.381

one day ago

Bug Fixes:

  • Fixed bug that results in incorrect type narrowing for sequence patterns in the negative (fall-through) case when the subject is a tuple with an unbounded entry.
  • Fixed recent regression that results in a false positive error when attempting to assign the expression type(Any) to type type[Any].
  • Fixed a bug that results in incorrect evaluation of a variable in a doubly-nested loop that is assigned a value in an assignment expression.
  • Fixed a bug that results in incorrect narrowing of types for TypeIs user-defined type guard in certain cases when variable type is a union.
  • [Contribution by @dcolascione] Fixed bug that results in a condition where imports stop resolving after file edits that change the set of modules that a file imports.
  • Fixed recent regression that results in incorrect type narrowing for isinstance in the negative case when using type as a filter.
  • Fixed bug that results in incorrect reporting of the Python version in a deprecation diagnostic message.
  • Fixed bug that results in incorrect code flow involving a call to a NoReturn callable with a function decorator applied.
  • Fixed bug that results in a spurious "symbol refers to itself" error under very specific conditions.
  • Fixed bug that can theoretically result in spurious errors when evaluating expressions that involve parameter symbols.
  • Fixed bug that results in incorrect type narrowing when TypeIs intersects type[A] with type[B]. Previously, pyright was producing <subclass of type[A] and type[B]> but now produces type[<subclass of A and B>].
  • [From pylance] Fixed recent regression that caused venvPath specified in language server settings to be ignored.
  • Fixed bug that results in a confusing error message extension referencing a missing __set__ method when assigning to a class variable that is not a descriptor object.
  • Fixed a bug that results in a false positive type error and confusing error message when assigning to a class variable that uses Self in its type definition.
  • Fixed a bug that results in spurious "variable not allowed in type expression" errors when a type alias is used in a loop in both a type expression and a value expression.

Behavior Changes:

  • Updated provisional support for TypeForm based on feedback to draft PEP 747.

Enhancements:

  • Expanded reportUnnecessaryIsinstance check to report cases where an isinstance or issubclass call always evaluates to False.
  • Improved error message for type violation in assignment statement where the LHS is an instance variable reference.
  • [From pylance] Update Unicode range tables to match Unicode 16.0, which is used for Python 3.14.

Don't miss a new pyright release

NewReleases is sending notifications on new releases.