Skip to content

Published 1.1.335

Compare
Choose a tag to compare
@github-actions github-actions released this 08 Nov 02:32
· 1301 commits to main since this release

Bug Fixes:

  • Fixed a bug that resulted in a false positive when validating type consistency between a metaclass instance and type[T].
  • Fixed bug that led to an inconsistency between the use of type and Type when applying isinstance type narrowing in some cases.
  • Fixed recent regression in the CLI that caused the --files command-line parameters to be overridden by the "include" setting in the config file.
  • Fixed bug that led to a false positive when assigning a lambda with *args to a callable type that doesn't contain *args.
  • Fixed a few places where union order resulted in different type evaluation behaviors.
  • Fixed a bug that led to a false positive error when specializing a type alias consisting of a callable parameterized by a TypeVarTuple.
  • Fixed bug that causes a false positive MRO error when creating a subclass of a generic TypedDict and another TypedDict.
  • Fixed a bug that results in incorrect type evaluation of a call expression when the callee is a function parameterized by a TypeVarTuple that has been specialized with a concatenation form.
  • Fixed several bugs in the signature help provider when handling **kwargs parameters typed with an unpacked TypeDict (PEP 692).
  • Added missing check described in PEP 692 where fields within an unpacked TypedDict used for **kwargs cannot overlap other keyword parameters in the same signature.
  • Fixed a false positive reportIncompatibleMethodOverride error under certain circumstances where an overloaded method overrides another overloaded method.
  • Fixed a bug that resulted in incorrect type evaluation when using a TypeVarTuple within a nested Callable type (i.e. a Callable that takes a Callable as a parameter).
  • Fixed bug that resulted in false positive reportIncompatibleMethodOverload error under certain circumstances.
  • Fixed a bug that causes a false positive reportUnnecessaryContains error when self is used on the LHS of the in operator within an enum class.
  • Fixed bug that led to a false negative when assigning type Class to Self@Class.
  • (Contribution by @JelleZijlstra) Fix missing space after "not" unary operator for expressions printed in output of reveal_type.
  • Fixed bug in completion provider that resulted in an attempt to tokenize and parse a binary (native) library file. This led to a crash in some cases.
  • Fixed a bug that results in a false positive error when a __new__ method returns Self for a generic class and the type variable is invariant.
  • Fixed a bug that led to incorrect type narrowing for the x is None in the negative (else) case when x is a bound TypeVar (or Self).

Enhancements:

  • Improved error message for descriptor accesses where binding or type validation fails for the __get__, __set__ or __delete__ methods.
  • Added missing error check for zero-argument form of super() when used within a static method.
  • Improved error message for member accesses.
  • Improved diagnostic message for method overrides based on keyword/position-only parameter mismatch.
  • Enhanced the handling of zero-argument form of super() to support the case where the containing method's self or cls parameter is annotated using a protocol. This can be used to handle mixin methods that call super().
  • Added support for boolean values in diagnosticSeverityOverrides language server setting.

Other Changes:

  • Updated heuristics for constructor evaluation to accommodate a wider range of types returned by the __new__ method. Previously, if the __new__ return type was anything other than a class instance, the heuristics assumed it wasn't intended and assumed that __new__ returned an instance of its class, as is usually the case.
  • Restored previous behavior (prior to 1.1.334) where an instance of a class that derives from Any will not be considered type compatible with None.
  • Significant rewrite of code that handles member accesses on class objects and class instances. This should improve internal consistency and fix many edge-case bugs. Due to the extent of this change, some regressions may result.