Bug Fix: Fixed bug in type narrowing code for literal enums. It wasn't correctly handling the edge case where the enum class has no enumerated members.
Bug Fix: Fixed bug in type narrowing logic for comparisons to literals that involve enums declared in a type stub. It was incorrectly narrowing the type to Never
in the negative (else) case.
Bug Fix: Fixed bug in type evaluator that resulted in incomplete (Unknown) types when variable types depend on each other within a loop and one of the expressions involves an unpack operator.
Bug Fix: Fixed bug in protocol TypeVar variance validation. Thanks to @Azureblade3808 for this contribution.
Enhancement: Added support for ellipsis type argument for a generic alias that uses a ParamSpec.
Bug Fix: Fixed bug that caused false positives when assigning a function to a generic class or callback protocol that is parameterized with a ParamSpec that is specialized using an ellipsis.
Bug Fix: Fixed several bugs where Type[None]
was incorrectly treated as compatible with None
and vice versa.
Bug Fix: Fixed bug that resulted in a false positive error when Required
or NotRequired
special forms were used with no type arguments in contexts where they are used as runtime class names rather than type annotations.
Behavior Change: Changed text representation of callables to more closely match the syntax introduced in PEP 677 including the use of "..." to represent "any parameters" and "**P" to represent a ParamSpec.
Bug Fix: Fixed error in pyrightconfig JSON schema, which duplicated a couple of IDs.
Bug Fix: Fixed bug that caused crash in type analyzer when a TypeVar of the same name was declared twice in the same scope with constraints in one case and without in the other.
Enhancement: Added support for draft PEP 677: callable type syntax.