Bug Fix: Fixed a bug that results in a crash when attempting to use a member access expression where the LHS is a TypeVarTuple.
Bug Fix: Fixed a bug that led to a false negative when analyzing code with an async context manager that swallows exceptions.
Enhancement: Improved error messages for situations where a call expression targets an overloaded function or method and there are no matches. Added some heuristics to pick the "best" overload function for the error message. Previously, pyright used the last overload, but this sometimes led to confusing errors.
Enhancement: Added support for the X is C and X is not C type guard pattern (where C is a class).
Bug Fix: Fixed an issue in type evaluation of call expressions where the callable subexpression evaluates to a union, and the callable subtypes have different signatures. Pyright was previously caching the types from the first subtype, so it didn't re-evaluate using the second subtype (which may require bidirectional type inference).
Bug Fix: Fixed bug in hover text where it was not producing the correct text output for an instantiable callable.
Enhancement: Added detection and reporting of illegal use of type[Callable] within a type annotation.
Bug Fix: Fixed a bug that resulted in a false positive error when bidirectional type inference was used with a class that defines a __new__ method within a generic class that returns an instance of the class whose type arguments do not match the type parameters.
Bug Fix: Fixed an inconsistency in reporting of unbound variables when the variable is captured by an inner scope. The new behavior correctly identifies unbound (or potentially unbound) variables in cases where the captured variable is narrowed. This happens when there are no assignments to the variable after it is captured.
Bug Fix: Fixed a bug that led to a false positive when a constrained type variable was used as a type argument in an annotation for an argument passed to a method that's bound to the same type variable.
Bug Fix: Improved robustness of handling of circular dependencies for class evaluations.
Enhancement: Enhanced support for functools.partial so it supports classes (constructors) when passed as the first argument.
Bug Fix: Fixed a bug that led to a false positive error when using bidirectional type inference for a dictionary expression when the expected type is a protocol.
Enhancement: Updated typeshed stubs to the latest version.
Bug Fix: Fixed a bug that led to a hang and eventual crash (due to memory exhaustion) under certain circumstances where a function returns a generic Callable whose type parameters are not used in the input parameters for the function.
Bug Fix: Modified the heuristics used for narrowing on assignment when the assigned type contains an Any. If the target's declared type does not contain Any, the assignment shouldn't produce an Any within the resulting type.
Enhancement: Added support within the constraint solver for higher-order functions that accept a callable parameterized with a ParamSpec where the passed callable is generic.
Bug Fix: Fixed a bug that resulted in the incorrect inferred variance for a type variable used within a frozen dataclass.
Bug Fix: Fixed a theoretical bug in the code that detects unique type signatures. It wasn't correctly handling constructor methods.
Bug Fix: Added support for type narrowing of a class pattern when the specified class is type() or a subtype thereof and the subject contains a type[X] whose metaclass potentially matches the pattern.
Published 1.1.318
Performance: Added code to handle pathological case in unannotated code that assigns values to the same variable hundreds of times with different types.
Bug Fix: Fixed a recent regression that resulted in unsolved type arguments when a "bare" generic class (like dict) is passed as an argument to a function that accepts a type[T].
Bug Fix: Fixed a bug in type narrowing for pattern matching in the negative (fall-through) case when the subject type contains an Any.
Enhancement: Added additional special-case handling for __init_subclass__ and __class_getitem__ to treat them as implicit class methods even if they are not declared using a def statement.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps pyright from 1.1.293 to 1.1.319.
Release notes
Sourced from pyright's releases.
... (truncated)
Commits
98a6792
Published 1.1.3191d558e0
Published 1.1.31888bff7e
Added fsevents to lock file.cc92429
Add fsevents as optional dependency to public package (#5503)8e021d2
[PylanceBot] Pull Pylance with Pyright 1.1.317 (#5505)2eee955
Published 1.1.31774d8f3c
pull-pylance-with-pyright-1.1.316 (#5401)67fe932
Published 1.1.316cef2712
Published 1.1.3150b49479
Published 1.1.314Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)