Bug Fix: Fixed a bug that results in a false positive when the return type annotation of a function requires code flow analysis to evaluate and a call expression is located on a code path between the function and the declared type referenced by the return type annotation. The fix is to skip "NoReturn" analysis in the code flow engine in this case (and several other similar cases) because it's not necessary. This has the added benefit of improving performance.
Bug Fix: Fixed misleading diagnostic message associated with reportUnnecessaryComparison
check when !=
operator is used in the expression.
Bug Fix: Added logic to better handle the case where a symbol is defined multiple times with a TypeAlias
declaration. This is an error condition, but it does occur in some stdlib type stubs if pyright is configured to use "All" for the "pythonPlatform" setting.
Enhancement: Improved type verifier so it can target submodules that are installed using an editable install mechanism.
Performance: Added small performance enhancement for protocol matching. When a protocol mismatch is detected, the remainder of the members are skipped if the caller hasn't requested detailed diagnostic information.
Performance: Added protocol matching optimization for the case where the source type and the destination protocol are both non-generic classes. In this case, we can safely cache the protocol relationship and shortcut future checks.
Bug Fix: Fixed bug in type narrowing logic for expressions of the form "X not in Y".
Bug Fix: Fixed a bug in the isinstance
and issubclass
type narrowing code paths. They were not handling nested tuples for the second argument.
Enhancement: Extended the "X in Y" type narrowing to support dict
, defaultdict
and OrderedDict
classes.
Bug Fix: Fixed bug that resulted in a false positive error when using ==
or !=
operator with type(None)
.
Bug Fix: Fixed a bug that led to a false negative in some instances when assigning an inappropriate type to a TypedDict key.
Bug Fix: Fixed a bug that led to a false positive when assigning a value to an index expression where the base type of the index was inferred rather than declared.
Bug Fix: Fixed a bug in completion provider that resulted in incomplete member suggestions when a LiteralString
type is used.
Bug Fix: Fixed a bug that resulted in a false positive error when evaluating an expression a + b
where a is a LiteralString
. For purposes of binary expression evaluation, LiteralString
should act like a str
.