Published 1.1.370
Bug Fixes:
- Fixed bug that resulted in a false negative when assigning to type
tuple[Never]
. - Fixed bug that results in incorrect type
isinstance
orissubclass
type narrowing when using a type variable with an upper bound that includes a promotion type. - Fixed recent regression that results in an assertion failure (and therefore a crash) when
type()
is called with dynamic base classes. - Fixed bug that results in a false positive when a protocol includes a method implementation that conditionally raises
NotImplementedError
. - Fixed bug that results in false positive
reportInconsistentOverload
andreportNoOverloadImplementation
errors when an overloaded decorator is applied to a non-overloaded function or method. - Fixed recent regression that results in false positive when a inner function with an inferred return type is a coroutine (async) and is referenced within the function body in which it's declared.
- (from Pylance) Fixed recent regression that results in diagnosticSeverityOverrides to be ignored if a pyproject.toml file is present, even if there is no
[tools.pyright]
section in it. - Fixed bug that results in incorrect type evaluation of a function that accepts a Callable[P, T] and is passed a class object whose constructor needs to be converted to a callable.
- Fixed bug that results in a spurious error when evaluating a quoted (forward reference) type expression that includes an index expression within a
TypeAlias
definition. - Fixed a bug in the type narrowing for the "x is " type guard pattern when
<class>
is a specific class T, as opposed to a variable of typetype[T]
. - Fixed bug that resulted in a false positive error when an abstract class is used for a
NewType
and the new type is constructed. - Fixed bug that results in the incorrect default value of a variadic type variable when the type argument is not provided. It should default to
*tuple[Any, ...]
, not*tuple[Any]
. - Fixed bug that results in a false negative when passing an extra keyword argument to a callable that is parameterized with a ParamSpec.
- Fixed bug that results in a false positive reportUntypedFunctionDecorator error under certain circumstances.
Enhancements:
- Updated typeshed stubs to the latest version.
- Improved analysis performance for complex code flow graphs by adding a cache for reachability.
- Implemented optimization in the protocol matching cache.
- Improved handling of special forms, including TypeAliasType instances, when used in value expressions.