Bug Fixes:
- Fixed bug that results in incorrect type narrowing when a value whose type is a non-callable (and non-final) class is passed as the second argument to an
isinstancecall and the first argument is a callable type. In this case, a subclass could provide a compatible__call__method, so the type shouldn't be narrowed toNever. - Fixed bug that results in a false positive "missing stub file" diagnostic when importing a "py.typed" submodule from a namespace package.
- Fixed bug that results in a false negative when a type variable with an upper bound is used to annotate a parameter in a method override.
- Fixed a bug that results in a false negative for a method override that uses
Selfin a contravariant position. - Fixed bug that results in a false positive error under certain circumstances involving a type variable with an upper bound of
type[T]that is assigned to another type variable. - Fixed a bug that results in a false negative when the specialization of a TypeVarTuple includes multiple unpacked tuples of unknown length.
- Fixed a bug that results in a false negative when a class that derives from
type[Any]is assigned to any other type. - Fixed bug that results in an incorrect error under certain circumstances when inferring the return type of a recursive function that has a decorator or is
async. - Fixed bug that results in a false negative when a return statement contains a call expression that invokes a
NoReturncall and the argument list contains errors. - Fixed bug that leads to a false positive in the
reportUnnecessaryComparisoncheck when one operand's type is a callable and the other is not. - [From pylance] Fixed a bug that results in an internal assertion (and therefore a crash) when
__builtins__.pyiimports from a project file.
Enhancements:
- Extended
deprecateTypingAliasesfeature to support symbols imported fromtyping_extensions. - Extended
reportUnknownVariableTypecheck to include cases where a value whose type is a generic class parameterized byUnknownis assigned to a variable with a declared type. - Extended the check for
isinstanceandissubclassargument validation to flag theLiteralspecial form, which leads to a runtime error when used in the second argument. - Updated typeshed stubs to the latest version. This version removes support for Python 3.8, which is now out of service.
Behavior Changes:
- Removed support for
ruandurstring prefixes. These were supported in Python 2.7 but are syntax errors in Python 3.x.