Enhancement: Updated typeshed stubs to the latest version. This includes the removal of stubs for freezegun.
Enhancement: Added support for draft PEP 698 and the @override decorator.
Enhancement: Enhanced reportSelfClsParameterName so it applies to overload signatures. In the general case, this check is not applied to functions with decorators because decorators can change the semantics of parameters for the decorated function. But @overload is a special case, and its semantics are well known.
Enhancement: Extended the defineConstant mechanism to work with conditional statements that contain member access expressions that reference a defined member name.
Published 1.1.275
Bug Fix: Fixed a bug that resulted in an incorrect type evaluation when a TypeVar bound to an Enum class is instantiated.
Bug Fix: Added a global "cache manager" to track heap usage for all type analyzer service instances. This prevents out-of-memory conditions when many roots are used in a multi-root workspace.
Behavior Change (from Pylance): Don't treat classes decorated with dataclass_transform as dataclasses for purposes of determining which fields should be represented in the synthesized __init__ method. This was an ambiguity in PEP 681, which was recently clarified.
Bug Fix: Fixed a bug that resulted in a false negative when using illegal annotation expression forms within a TypedDict inlined (call-based) definition.
Bug Fix: Fixed a bug in the code flow engine that resulted in incorrect type evaluation in certain cases involving nested loops.
Bug Fix: Fixed a bug that resulted in a false positive error when a call targets an object with a __call__ that is itself an object with a __call__ method.
Bug Fix: Added a check for a return statement with an explicit return value within an async generator function. This is considered a syntax error by the Python compiler, so it should be flagged at static analysis time.
Bug Fix: Fixed a bug that resulted in incorrect handling of binary files (e.g. ".so" or ".pyd" files) within a library when creating stub files.
Behavior Change: Enhanced the heuristics used to infer the type of an unannotated function parameter with a default value. If that value evaluates to an instance of a class with a private name (i.e. it starts with an underscore), pyright will now assume that the value is potentially a singleton sentinel value similar to None and will infer the type to be a union of that type and Unknown.
Published 1.1.274
Bug Fix: Fixed a bug that resulted in incorrect type evaluation for members of a StrEnum subclass under certain circumstances. This was caused by a circular dependency in ReprEnum caused by pyright's validation of __init_subclass__ as part of class type evaluation. This change moves this validation step from the type evaluator to the checker, eliminating the potential for circular dependencies and improving performance.
Bug Fix: Fixed a bug that resulted in a false positive error indicating that a type definition relies on itself in a circular manner.
Bug Fix: Fixed a bug that resulted in incorrect type evaluation for constructor calls using bidirectional type inference where the expected type includes TypeVars that are not in scope for the constructor call.
Bug Fix: Fixed a bug that resulted in incorrect type narrowing based on literal field discrimination (<a>.field == <literal>) where the expression <a> is a member access expression.
Bug Fix: Fixed a bug in the "--verifytypes" CLI option that resulted in incorrect calculation of the type completeness core in cases where a private symbol with an incomplete type was imported and re-exported from a public module.
Bug Fix: Fixed a bug that resulted in incorrect analysis when a ClassVar annotation was enclosed in quotes (i.e. a forward reference).
Bug Fix: Fixed a bug that resulted in a false positive error when a contravariant generic class was specialized with a union type argument used with bidirectional type inference.
Enhancement: Updated typeshed stubs to the latest.
Published 1.1.273
Bug Fix: Fixed recent regression that resulted in a false positive error related to argument-to-parameter matching.
Enhancement: Added a missing check for class-scoped covariant or contravariant TypeVars that are used in a base class where the base class defines the corresponding type parameter to be invariant. This leads to a typing hole, so it should be considered an error.
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.271 to 1.1.276.
Release notes
Sourced from pyright's releases.
... (truncated)
Commits
7991887
Published 1.1.276779b872
Published 1.1.275fdc9844
Published 1.1.274f04730c
Published 1.1.273a7f3fdd
Published 1.1.272df789b5
pull-pylance-with-pyright-1.1.271 (#3946)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)