Enhancement: Improved type evaluation of yield from expression so it handles operands that are unions.
Bug Fix: Added code to handle the case where a module uses an from A.B.C import X statement within the A/B/C/__init__.py module.
Bug Fix: Fixed a type evaluation bug that produces a false positive when using bidirectional type inference for nested call expressions when the target callables are generic.
Behavior Change: Reduced the default output of the CLI.
Bug Fix: Fixed a bug in the isinstance and issubclass type narrowing when the types have no overlap and one or both is @final. In this case, the narrowing should result in a Never rather than an intersection type.
Bug Fix: Fixed a bug that resulted in a false positive error when constructing a tuple of classes in the second argument of an isinstance or issubclass call.
Bug Fix: Fixed a bug that resulted in false positive errors when overlapping roots were used in a multi-root workspace and new workspaces are added after one of these shared files was already open in the editor.
Bug Fix: Fixed a bug that resulted in a false positive error when doing protocol matching when there are multiple levels of protocol inheritance and a method that uses Self in its signature.
Bug Fix: Fixed inconsistent evaluation of a class type when calling a generic constructor that accepts a type[T] parameter and a union of classes is passed as an argument.
Behavior Change: Changed the behavior of the reportIncompatibleMethodOverride check to exempt the case where the base class or override has a type that is defined by Callable[..., X]. The ... means that it's compatible with any signature. Also fixed a false negative in this check where the base method contains a **kwargs parameter but the override does not.
Bug Fix: Fixed bug that caused useLibraryCodeForTypes to default to false in the CLI if it was not overridden in the config file. Version 1.1.305 was intended to change the default to true, but it didn't.
Bug Fix: Fixed a confusing and inappropriate diagnostic addendum when a function with positional-only parameters is assigned to another function with positional-only parameters but has a parameter count mismatch. The old logic output an inappropriate message about a keyword-only parameter.
Bug Fix: Fixed a bug in the --verifytypes command-line tool that affected the case where a submodule was specified (e.g. --verifytypes a.b.c) and the final nested module was a single file (e.g. c.py) rather than an __init__.py within a folder.
Enhancement: Added support for a generic NamedTuple class — i.e. a class that uses NamedTuple as a base class along with type parameters defined in a Generic[...] base class and then uses these type parameters in type definitions for the NamedTuple entries.
Enhancement: Implemented check for conditional statement operands. Such operands must support a __bool__ method that returns a bool return type. Any other type is treated as an error by the runtime.
Enhancement: Added special-case handling for methods within generic classes parameterized by a ParamSpec when those methods use *args: P.args, **kwargs: P.kwargs in their signature and the callable signature captured by the ParamSpec is from a generic function. In this case, the TypeVar scope of the captured function is retained so its type variables can be solved when the method is solved. This is useful for generic callback protocol classes that implement a __call__ method.
Enhancement (by debonte): Added provisional support for draft PEP 712, which introduces support for a converter parameter in a field descriptor for dataclass and dataclass_transform.
Bug Fix: Eliminated the code that treats unions within value expressions as a UnionType object. This behavior caused various problems including a false positive in some cases.
Published 1.1.305
Bug Fix: Fixed a bug that resulted in incorrect type comparison results (which led to incorrect type narrowing) when Annotated was used in some circumstances.
Bug Fix: Fixed bug that led to a false positive error when a ParamSpec captures a signature that includes an *args or **kwargs and then is called using an unpacked iterable (for *args) or an unpacked Mapping (for **kwargs).
Enhancement: Added diagnostic for # pyright comment that controls file-level settings that is not on its own line (i.e. doesn't start in column 1).
Bug Fix: Fixed bug that resulted in a false positive error when importing a type alias via a wildcard import.
Bug Fix: Fixed bug in inference of generator function return type that led to false positive error. The "send" type (the second of three type arguments for a Generator) cannot be inferred precisely, so it should be Unknown rather than None. Modified the "send type" type inference logic for generators. Instead of always inferring Unknown, pyright now infers Any if the send type is provably never used within the generator. This is a common case and allows the generator function return type to be inferred without an Unknown partial type in most cases.
Bug Fix: Fixed a bug that led to a false positive error when a partially-specialized generic function with a ParamSpec is further specialized such that the ParamSpec is bound to ... (i.e. the ParamSpec equivalent of Any).
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.306.
Release notes
Sourced from pyright's releases.
... (truncated)
Commits
66b6672
Published 1.1.306a359c84
Published 1.1.3059f3e150
Published 1.1.3040204184
Published 1.1.3031e8ee8f
Published 1.1.302a218860
Published 1.1.301f9a7382
Published 1.1.3006de7375
Push pylance changes to pyright (#4783)cebfc31
Bump webpack from 5.75.0 to 5.76.0 in /packages/pyright (#4774)ac9b89c
Published 1.1.299Dependabot 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)