Added code to properly print a f-string expression in pyright's "expression printer". This affected stub generation if an f-string was used (e.g. in call to a decorator).
Fixed a bug that resulted in a false positive error when using a bound TypeVar in an except statement.
Fixed a bug that led to a false negative when using a non-data protocol class in a tuple within an issubclass check.
Fixed a bug that resulted in incorrect inference of an async generator expression if an await keyword was used in a for iterator expression.
Fixed a bug that resulted in an incorrect type evaluation for a sliced tuple if the end of the slice is the same as the tuple length (off-by-one error).
Fixed recent regression that results in a false positive error when an unpack operator is used in an Annotated type annotation.
Fixed false negative when a special form is assigned to a value declared as type[T] or when instantiated.
Added support for generic type alias specialization when the type alias includes an unpacked TypeVarTuple and the specialization list includes an unpacked unbounded tuple.
Fixed bug that led to incorrect protocol matching for class objects.
Fixed recent regression whereby a type created with NewType was no longer allowed as an argument for another NewType.
Fixed a bug that resulted in an incorrect implied specialization of a generic type alias that is parameterized by a TypeVarTuple. The implied type argument should be *tuple[Unknown, ...] in this case.
Fixed a bug in class pattern matching logic that incorrectly narrows types when using a str() class pattern and a LiteralString subject.
Fixed bug that caused "final method override" diagnostic to have no associated diagnostic rule.
Fixed a bug that resulted in incorrect variance inference for protocols (and for PEP inferred-variance TypeVars in PEP 695) when a self or cls parameter is explicitly annotated with a type that includes the type parameter.
Fixed a bug that resulted in a false positive when a contravariant TypeVar was used in a return type in a non-method.
Behavior Changes:
Changed the way pyright identifies an "unimplemented protocol method" within a stub file. It now looks at whether the method is decorated with @abstractmethod. Previously, it assumed all such methods were potentially implemented.
Changed error reporting for non-protocol classes that derive from a protocol but don't implement all of the unimplemented symbols in the protocol. Previously, pyright reported the error on the class declaration. Now, it reports it at instantiation time. This is more consistent with what other type checkers do.
Enhancements:
Updated typeshed to the latest version.
Added provisional support for proposed extension to typeshed's VERSION mechanism (python/typeshed#11260).
Added support for + unary operator in Literalint type annotations. The typing spec was recently amended to allow this.
Improved handling of special forms defined in the typing module so they are treated correctly when used as runtime objects.
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 show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@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.345 to 1.1.346.
Release notes
Sourced from pyright's releases.
Commits
56fe9e1
Published 1.1.346Dependabot 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 show