npm pyright 1.1.400
Published 1.1.400

latest releases: 1.1.407, 1.1.406, 1.1.405...
8 months ago

Bug Fixes:

  • Fixed bug that results in a false positive when accessing a generic attribute from an object whose type is type[X].
  • Fixed bug that results in incorrect type narrowing of a variable that is shadowed in an inner-scoped comprehension.
  • Fixed bug that results in a false positive error when referencing a class-scoped type alias defined as a callable.
  • Fixed bug that causes bidirectional type inference not to be used in cases where a ternary expression is assigned to an annotated instance or class variable and the ternary condition narrows the type of self or cls.
  • Fixed bug that results in a spurious "type already specialized" error when using a class-scoped type alias defined using a type statement or TypeAliasType constructor.
  • Fixed a bug that leads to a hang when a generic type alias definition refers to itself.
  • Fixed a bug that results in missing diagnostic details under certain circumstances where bidirectional type inference is attempted in the assignment of an attribute.
  • Fixed a bug that results in a false positive error when calling a function with an unpacked TypedDict with extra_items when additional keyword args are passed.
  • [From pylance] Fixed regression introduced in 1.1.399 that caused pyright CLI to fail to run on Linux systems.

Enhancements:

  • Extended "type(x) is C" type narrowing logic to support cases where C is a union of types or a type variable with a union upper bound.
  • Added support for PEP 765, which makes it a syntax error (or warning) in Python 3.14 if a return, break or continue is used to exit a finally clause.
  • Added check for named tuple field names that begin with an underscore. These result in a runtime exception.

Behavior Change:

  • Reverted a recent change that extended the reportPrivateImportUsage check to enforce imports from submodules whose names begin with an underscore. This change was disruptive to users of the popular pandas library because it exports a submodule named _typing. This was originally intended to be experimental or private, but it was never fully addressed. The pandas maintainers will work to fix this issue (pandas-dev/pandas#55231) over the next year. I'm going to back out this change to pyright in the meantime.

Don't miss a new pyright release

NewReleases is sending notifications on new releases.