Published 1.1.335
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
andType
when applyingisinstance
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 nestedCallable
type (i.e. aCallable
that takes aCallable
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 whenself
is used on the LHS of thein
operator within an enum class. - Fixed bug that led to a false negative when assigning type
Class
toSelf@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 returnsSelf
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 whenx
is a bound TypeVar (orSelf
).
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'sself
orcls
parameter is annotated using a protocol. This can be used to handle mixin methods that callsuper()
. - 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 withNone
. - 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.