Skip to content

Published 1.1.363

Compare
Choose a tag to compare
@github-actions github-actions released this 15 May 05:02
· 77 commits to main since this release

Bug Fixes:

  • Updated manifest to reflect the correct default value for reportInvalidTypeForm.
  • Fixed bug that resulted in diagnostics associated with the reportUnnecessaryTypeIgnoreComment check to not include the error code.
  • Fixed bug that causes a false positive reportPrivateUsage error when a global or nonlocal binding is used within a class to access an outer-scoped variable.
  • Fixed bug that results in a false positive reportUnnecessaryComparison when a variable is used in a conditional expression and its type is a union that includes a Coroutine and a non-coroutine.
  • Fixed false positive deprecatedTypingAliases deprecation for collections.abc.AbstractSet due to a recent change in typeshed stubs.
  • Fixed recent regression that results in assert_type failure when a class is parameterized by a ParamSpec with a default value.
  • Improved handling of constrained TypeVars when used with unary operators.
  • Fixed bug that results in incorrect type narrowing for a tuple with determinate length when indexed with an out-of-bounds slice.
  • Fixed bug that results in incorrect type narrowing for isinstance or issubclass type guard when the filter is a generic class whose type parameter has a default value.
  • Fixed bug that results in incorrect type evaluation behavior within class body of an enum class when one enum member is used to define another enum member. This involved a significant rewrite of the logic involving enum symbol evaluation.
  • Fixed a bug that results in a false positive error when a decorator is applied to a property.
  • Fixed bug that resulted in false positive when evaluating a function call involving a TypeVarTuple under certain circumstances.
  • Fixed a bug that results in incorrect type evaluation when a function parameterized with a TypeVarTuple is passed as an argument to another function parameterized with a TypeVarTuple.

Behavior Changes:

  • Deferred execution of type annotations (PEP 649) did not make it into Python 3.13 and has been deferred (again) until Python 3.14. Changing pyright's logic accordingly.
  • Changed the type evaluation for type(Any) or type(x) where x is a value of type Any or Unknown. These now evaluate to type[Unknown].
  • Changed the TypeVar scoping behavior for TypeVars that appear only within a Callable subtype within a function's declared return type. Previously, pyright scoped these TypeVars to the Callable rather than the function. This was due to issue #4285. I'm reversing this decision because it's not spec-compliant, creates a bunch of unnecessary complexity, and results in buggy behavior.