Behavior Change: Changed the reportUnusedImport
check to not report an error for "from y import x as x" since x
is considered to be re-exported in this case. Previously, this case was exempted only for type stubs.
Enhancement: Expand enums in negative narrowing of x in y
.
Bug Fix: Fixed bug that resulted in incorrect type evaluation when an f-string uses expressions that are unions of literal strings. The result should be LiteralString
, not str
.
Enhancement: Improved the reportUnnecessaryComparison
diagnostic check to detect (and properly report) cases where a comparison if literals is always true or always false.
Bug Fix: Fixed bug that resulted in incorrect type evaluation when creating a union from two generic functions that are parameterized by different ParamSpecs but are otherwise identical.
Behavior Change: Updated the default Python version from 3.10 to 3.11 now that 3.11 has been released in its final form. Pyright assumes the default version if it is not otherwise told which version to use (explicitly as a setting or command-line argument or implicitly via the selected Python environment).
Enhancement: Enhanced --verifytypes
so it honors the --pythonversion
and --pythonplatform
command-line arguments and falls back to the selected Python environment to get these values if they are unspecified.
Bug Fix: Fixed a bug in the type evaluator related to TypeVarTuple that caused it to incorrectly report a type incompatibility between *Ts
and *tuple[*Ts]
. These are the same type, so they should be compatible.
Bug Fix: Fixed a bug that results in incorrect specialization of a function or method that uses a TypeVarTuple parameter. The internal flags were being lost including the tracking of class methods and static methods.
Bug Fix: Added support for unpacked tuple arguments passed to an *args
parameter declared with a TypeVarTuple.