Bug Fix: Fixed recent regression that led to a false positive error when useLibraryCodeForTypes was false and an import of the form from a.b import c targeted a namespace package a.b that contains a traditional package c.
Bug Fix: Fixed bug that resulted in incorrect type narrowing for case statements that involved sequence patterns when the subject included a recursive type alias.
Enhancement: Added support for functools.partial when the provided function is overloaded.
Bug Fix: Fixed bug that resulted in a false positive when evaluating the types of nested generic function calls when bidirectional type inference is required.
Bug Fix: Fixed bug that resulted in an unresolved Unknown type in a doubly-nested loop when the value comes from a call to an overloaded function or magic method.
Enhancement: Improved type inference for enum values in an enum class created with the one-line form x = Enum("x", "a b c").
Bug Fix: Improved error handling for enum classes created with the one-line form x = Enum("x", "a b c"). The code now handles other whitespaces and commas and properly checks for format strings.
Enhancement: Added support for other functional Enum calls including a list of strings, a tuple of strings, a list of tuples, a tuple of tuples, and a map.
Enhancement: Added support for type evaluation of lambdas that are immediately called. The inferred types of the lambda's parameters must be inferred from the argument types in this case.
Bug Fix: Fixed recent regression that causes a false positive when a variable is assigned an expression of ... within a type stub file and strict type checking is enabled.
Bug Fix: Fixed a bug that leads to a false positive error when evaluating the type of a method that contains a function-scoped ParamSpec when the method is partially specialized through a binding operation.
Enhancement: Improved overload filtering for constructor calls when the class defines no __init__ but does define an overloaded __new__.
Enhancement: Added limited support for type narrowing of subexpressions of the subject expression for match statements. In particular, added support for discriminated TypedDicts and tuples that are discriminated on literals.
Enhancement: Enhanced type narrowing in the negative (not matched) case for sequence pattern matching when the subject is a tuple of known length. In cases where the pattern narrows one tuple entry in the positive case, we can eliminate that subtype in the negative case.
Enhancement: Enhanced type narrowing for pattern matching in cases where the subject is a tuple expression and one of the entries is a subexpression that is later used in a case statement block.
Published 1.1.303
Behavior Change: This change may require changes to your configuration. Changed the default of the useLibraryCodeForTypes from false to true to bring pylance and pyright into alignment. Also deprecated the "--lib" command-line option, which was previously used to enable useLibraryCodeForTypes from the command line. If your project relies on the old default value, you will need to explicitly set useLibraryCodeForTypes to false in your project’s configuration file.
Behavior Change: Changed reportImportCycles so it is not on by default in "strict" type checking mode. It is highly opinionated and should be used only in cases where the developer opts into it.
Enhancement: Improved the synthesized __init__ method of a TypedDict class so it accepts another instance of the same TypedDict (or another TypedDict that is type compatible) as an argument. This makes pyright compatible with mypy in this regard.
Bug Fix: Added the ability for any callable to conform to a protocol that includes attributes and methods defined in the pseudo-class builtins.function.
Bug Fix: Fixed a bug that resulted in incorrect type evaluation when a partially-specialized generic method (with method-scoped type variables) is passed multiple times to a function that accepts generic callables.
Behavior Change: Reverted recent change that validated that explicitly-annotated self and cls in overloaded methods was a subtype of the class that contains them. This change made pyright consistent with mypy, but feedback from pyright users indicated that it was not desired. There are legitimate use cases for this in the overload case.
Bug Fix: Fixed bug that led to incorrect type narrowing for mapping patters in a case statement if the type included a recursive type alias.
Bug Fix: Fixed bug that potentially resulted in internally corrupted state when a class or def statement appears within a conditional block that is determined by the binder to be unreachable.
Bug Fix: Fixed a bug that resulted in a false positive error when assigning a function that has one or more tuple parameters to a generic callable that also accepts tuple parameters.
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.304.
Release notes
Sourced from pyright's releases.
... (truncated)
Commits
9f3e150
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.299574fc59
Published 1.1.298d016ff4
Published 1.1.297Dependabot 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)