Bug Fixes:
- Changed the fallback type from Unbound to Unknown for the case where pyright determines that a symbol requires code flow analysis but the execution scope exceeds the cyclomatic complexity threshold.
- Fixed a bug that results in a false positive "recursive type definition" error under certain circumstances when the number of declarations for a symbol exceeds the internal threshold of 16.
- Fixed a bug that results in incorrect handling of a "bare" ClassVar annotation either with or without an assignment.
- [From pylance] The default python version was not being picked up from the environment.
- Fixed bug that results in false negative when a parameter is used within a type expression and the parameter's type is a TypeVar or Self.
- Fixed bug that results in a false negative when two import statements shadow the same symbol and an attribute is accessed between the two import statements.
- Fixed bug that results in a crash (due to infinite recursion) if an enum class uses a reference to an enum member in an annotation for that same enum member.
- Fixed a bug that results in incorrect type evaluation when passing a function with a callable parameter that uses Concatenate plus ParamSpec to a function that accepts a callable with just a ParamSpec.
- Added missing check for illegal use of
Final
within a TypedDict or NamedTuple definition. - Tweaked the algorithm for computing the complexity of a code flow graph to accommodate slightly larger graphs before giving up.
Enhancements:
- Updated typeshed stubs to the latest version.
- Added
@override
enforcement for an overloaded method that has no implementation. - Added code to conform with the new checks mandated in the typing spec for
@final
and@override
applied to an overload. - Extended type narrowing for the
X is L
andX is not L
type guard pattern. Previously, narrowing was performed only whenL
was an enum or bool literal. Narrowing is also now applied for other literal types but only in the positive (if
) direction. - Modified the overload call evaluation logic to conform with the new proposed type specification rules regarding
*args
parameters. - Added support for argument type expansion of bool, enums, and tuples of fixed length when evaluating overloads. This behavior is mandated by the new draft typing spec update.