github microsoft/pyright 1.1.375
Published 1.1.375

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

Bug Fixes:

  • Fixed bug that results in a false positive error when a covariant type variable that is scoped to a method is used in a parameter annotation.
  • Fixed bug that leads to internal data structure corruption and subsequent false positive errors in certain cases involving unions of Unknown types that include type aliases.
  • Fixed bug in the functools.partial logic that results in incorrect handling of an unpacked TypedDict when used with a **kwargs parameter.
  • Fixed bug that results in a false positive reportUnsupportedDunderAll warning when using the __all__.extend(x.__all__) form and the list of entries in x is empty.
  • Fixed bug in TypeVar auto-variance calculations for NamedTuples. Since NamedTuple variables are read-only, they should not cause a TypeVar to be invariant.
  • Added subtyping support or IntEnum and StrEnum members. These literal values are subtypes of the corresponding literal int or str.
  • Fixed bug that results in a false positive error under certain circumstances when passing an overloaded function as an argument to a call.
  • Fixed bug that caused first argument of cast method on memoryview object to be treated as a type expression. Pyright was confusing this method with typing.cast.
  • Fixed a bug that results in incorrect overload matching when one overload contains a zero-arity variant and another overload contains an *args (variadic) parameter.
  • Fixed a bug that results in incorrect type narrowing for truthy/falsy type guards consisting of an Enum member when the enum class derives from ReprEnum. In this case, the "magic" of the enum implementation forwards the __bool__ call to the underlying value.
  • Fixed a bug that results in incorrect type narrowing when using isinstance with an instance of a generic class as the first argument and a concrete subclass as the filter type.
  • Fixed bug in type narrowing logic for value patterns, specifically when two enums with members of the same name are involved.
  • Fixed bug that causes infinite recursion and memory exhaustion under certain circumstances involving recursive type aliases where the type alias is used as a type argument.

Enhancements:

  • Updated typeshed stubs to the latest version.
  • Added support for bool expansion to Literal[True] | Literal[False] during pattern matching when using value patterns.

Behavior Changes:

  • Changed disableLanguageServices feature to apply to hover text as well as other language services. Previously, hover text was excluded.
  • Allow Final and ClassVar to be combined in both directions within a dataclass. Previously, the Final qualifier needed to be the outermost.

Don't miss a new pyright release

NewReleases is sending notifications on new releases.