Bug Fixes:
- [From pylance] Fix problem with partial stub service not being part of Pyright CLI.
- Added additional special-casing to
x in y
type guard logic to handleLiteralString
values. - Partially eliminated inconsistent error reporting when calling a function with a default argument that is not assignable to the declared parameter type. An error will still be reported in the case where the declared parameter type includes an unsolved type variable in most cases, but it will no longer be reported if the unsolved type variable is due to a pseudo-generic class.
- Fixed bug that results in an identifier being marked "unaccessed" if it is used in an argument expression to a call whose type is possibly unbound.
- Fixed bug that leads to a false negative when evaluating a call expression where the callable type is
Any
and an argument expression uses dictionary unpacking but the operands type is not a mapping. - Fixed a bug that results in an incorrect "Unknown" type evaluation under certain circumstances involving an assignment to an annotated variable within a loop.
- Fixed bug that results in incorrect bidirectional type inference when using nested constructor calls for dataclasses.
- Fixed a bug that results in incorrect "literal math" results when using a floor divide
//
operator with literal operands whose signs differ. - Fixed a bug that results in a hang under certain circumstances when inferring the return type of a recursive function.
Enhancements:
- Changed type evaluator to make a best effort to evaluate the return type of a function call even if arguments are missing.
- [From pylance] Implement support for pull diagnostics in pyright.
- Added code to enforce that an argument in a call expression that is unpacked is iterable.
- Improved support for unused import detection for import statements that target multi-part names.
Behavior Changes:
- Changed the type of
__path__
fromIterable[str]
toMutableSequence[str]
. Both are correct, but the latter is more precise. - Improved determinism of
--threads
diagnostic output by always sorting output by file path. - Improved reproducibility of CLI diagnostics in non-threaded case by sorting output by file path.