Bug Fix: Fixed crash that occurs when encountering a malformed system version check of the form sys.version_info[0] < 3.8
.
Enhancement: Improved error message for yield
statements when the yield type is a TypedDict or other type that requires bidirectional type inference.
Bug Fix: Fixed regression in type(x) is y
type narrowing logic when y
is of type type[Self]
.
Bug Fix: Fixed a bug in protocol matching logic that resulted in a false positive error when a class implementation used a callback protocol rather than a def
statement to define an instance variable defined in a protocol.
Bug Fix: Fixed a bug that resulted in an unresolved Unknown
type within a tuple constructed within a loop.
Bug Fix: Fixed several bugs in protocol matching that led to false positives when matching a protocol against a module.
Behavior Change: Changed type evaluation behavior for accesses to attributes on a class that derives from Any
. Previously, these were evaluated as Unknown
, but they are now evaluated as Any
.
Bug Fix: Fixed a bug in the reportIncompatibleMethodOverride
check that leads to a false negative if the base class uses a Self
type and the override uses an incompatible specialized type.
Enhancement: Added logic to detect illegal use of the symbol Any
.
Enhancement: Added logic to perform basic reformatting (especially dedenting) of deprecation messages used with @deprecated
.
Bug Fix: Fixed a bug in the isinstance type guard logic when the specified filter class (the second argument) is a metaclass (a subclass of type
).
Bug Fix: Fixed a bug in the issubclass
type narrowing logic when the first argument is a metaclass (a subclass of type
).
Enhancement: Updated typeshed stubs to the latest version.
Behavior Change: Changed override-related checks (reportIncompatibleMethodOverride
, reportIncompatibleVariableOverride
and reportImplicitOverride
) so they apply to stub files. Previously, these were skipped for stubs.
Bug Fix: Fixed a bug that caused types captured by ParamSpecs to sometimes be printed with Unknown
parameter types.
Bug Fix: Fixed a bug in ParamSpec type matching that resulted in an incorrect type evaluation under certain circumstances.
Bug Fix: Fixed a regression in overload matching that resulted in false positive errors in hydra-zen. This change involves removing a heuristic from overload matching that attempted to eliminate a false positive error for x: list[str] = "a,b".split(",")
.
Bug Fix: Fixed a bug that results in confusing error messages when converting a constructor (an __init__
method) to a function type. The resulting function should not be named __init__
but should be anonymous.
Bug Fix: Fixed a bug that led to a false positive error when a type alias created using PEP 695 syntax is used as a type argument for a generic type when used in the LHS of a call expression.
Bug Fix: Fixed a bug in the isinstance
type narrowing logic when using a generic class whose type parameters include defaults (PEP 696).
Bug Fix: Fixed a false positive error "TypeVar bound cannot be generic" if the bound type is a generic class whose type parameters have default types (using PEP 696).
Bug Fix: Fixed bug in "type printer", the code that converts a type to text for error messages. It wasn't properly handling type(t)
where t
is defined using a type alias.
Enhancement: Improved the error message for metaclass conflicts so the conflicting metaclasses are specified.
Bug Fix: Fixed a bug in the type narrowing logic for sequence patterns, specifically when the subject is Any
or Unknown
and the sequence pattern is empty ([]
).
Bug Fix: Fixed a bug with path normalization (in particular, drive letter) for symbolic links that resulted in false positive errors.
Bug Fix: Fixed a bug that led to a false positive error when attempting to instantiate a value of type type[Self]
when Self
refers to an abstract class.
Bug Fix: Fixed a bug that led to a false positive error when passing type(None)
or NoneType
as the second argument to issubclass
.
Bug Fix: Fixed a bug in the issubclass
type narrowing logic for type(None)
and NoneType
filters.
Bug Fix: Fixed a bug that led to a stack overflow crash under certain circumstances when evaluating a function call with a ParamSpec.
Bug Fix: Fixed bug that prevented ReadOnly
experimental feature from being used in a file where a # pyright: enableExperimentalFeatures=True
comment was used.