Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 1.1.391 #959

Merged
merged 18 commits into from
Dec 18, 2024
Merged

Merge 1.1.391 #959

merged 18 commits into from
Dec 18, 2024

Conversation

DetachHead
Copy link
Owner

fixes #949

erictraut and others added 18 commits December 5, 2024 16:20
…`Self` is errantly specialized. This addresses #9552.
…Final` qualifier are both used on the same dataclass attribute. This addresses #9550. (#9553)
…rgument expression in certain circumstances. This addresses #9558 and #9536. (#9560)
… entry when the entry is defined by a generic subclass. This addresses #9545. (#9567)
…s used and a subclass overrides an attribute that is generic in the base class. This addresses #9448. (#9569)
…wildcard patterns in a `case` clause. This addresses #4706. (#9582)
…dling long file lists provided via stdin. This addresses #9583. (#9585)
…ator overload method like `__add__` is implemented with a descriptor object. This addresses #9574. (#9587)
…fytypes` while targeting a submodule within a package and that submodule is a single-file module. This addresses #9529.
…ects the case where the filter type is a metaclass. This addresses #9441. (#9588)
…ircumstances involving converter functions in a dataclass. This addresses #9594. (#9597)
# Conflicts:
#	docs/configuration.md
#	lerna.json
#	packages/pyright-internal/package-lock.json
#	packages/pyright/package-lock.json
#	packages/pyright/package.json
#	packages/vscode-pyright/package-lock.json
#	packages/vscode-pyright/package.json
… simple wildcard patterns in a `case` clause. This addresses #4706. (#9582)"

our exemption logic is better because it still reports the error if the wildcard case is not used to assert that it's unreachable

This reverts commit 9041f88
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

psycopg (https://github.com/psycopg/psycopg)
-   /tmp/mypy_primer/projects/psycopg/psycopg_pool/psycopg_pool/null_pool.py:109:20 - error: "type[Unknown]" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/psycopg/psycopg_pool/psycopg_pool/null_pool_async.py:104:20 - error: "type[Unknown]" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
- 2015 errors, 38554 warnings, 0 notes
+ 2013 errors, 38554 warnings, 0 notes

sympy (https://github.com/sympy/sympy)
+   /tmp/mypy_primer/projects/sympy/sympy/core/function.py:920:16 - error: Type "Self@UndefinedFunction" is not assignable to return type "type[AppliedUndef]"
+     Type "Self@UndefinedFunction" is not assignable to type "type[AppliedUndef]" (reportReturnType)
+   /tmp/mypy_primer/projects/sympy/sympy/polys/polyoptions.py:73:9 - error: Argument of type "Self@OptionType" cannot be assigned to parameter "value" of type "type[Option]" in function "__setitem__"
+     Type "Self@OptionType" is not assignable to type "type[Option]" (reportArgumentType)
-     Type of "P" is "(condition: Unknown, given_condition: Unknown | None = None, numsamples: Unknown | None = None, evaluate: bool = True, **kwargs: Unknown) -> (Unknown | Any | BernoulliDistribution | Probability | Zero | One | Expr | Float | ComplexInfinity | Rational | NaN | NegativeOne | Integer | Half | Infinity | NegativeInfinity | _NotImplementedType | Self@Expr | tuple[Unknown, ...] | Sum | Add | Piecewise | Basic | Equality | Lambda | Number | int | None)" (reportUnknownVariableType)
+     Type of "P" is "(condition: Unknown, given_condition: Unknown | None = None, numsamples: Unknown | None = None, evaluate: bool = True, **kwargs: Unknown) -> (Unknown | Any | BernoulliDistribution | Probability | Zero | One | Expr | Float | ComplexInfinity | Rational | NaN | NegativeOne | Integer | Half | Infinity | NegativeInfinity | _NotImplementedType | Self@Expr | tuple[Unknown, ...] | Sum | Piecewise | Basic | Equality | Lambda | Number | int | None)" (reportUnknownVariableType)
-     Type of "E" is "(expr: Unknown, condition: Unknown | None = None, numsamples: Unknown | None = None, evaluate: bool = True, **kwargs: Unknown) -> (Unknown | Basic | Expectation | Expr | tuple[Unknown, ...] | Sum | Self@Expr | Any | Add | Zero | NaN | Piecewise | Equality | Integral | ExpectationMatrix | Literal[0] | None)" (reportUnknownVariableType)
+     Type of "E" is "(expr: Unknown, condition: Unknown | None = None, numsamples: Unknown | None = None, evaluate: bool = True, **kwargs: Unknown) -> (Unknown | Basic | Expectation | Expr | tuple[Unknown, ...] | Sum | Self@Expr | Any | Zero | NaN | Piecewise | Equality | Integral | ExpectationMatrix | Literal[0] | None)" (reportUnknownVariableType)
-     Type of "H" is "(expr: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (int | Expr | Basic | Expectation | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Any | Add | Zero | NaN | Piecewise | Equality | Integral | ExpectationMatrix | None)" (reportUnknownVariableType)
+     Type of "H" is "(expr: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (int | Expr | Basic | Expectation | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Any | Zero | NaN | Piecewise | Equality | Integral | ExpectationMatrix | None)" (reportUnknownVariableType)
-     Type of "covariance" is "(X: Unknown, Y: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (CrossCovarianceMatrix | Covariance | Unknown | Basic | Expectation | Expr | tuple[Unknown, ...] | Sum | Self@Expr | Any | Add | Zero | NaN | Piecewise | Equality | Integral | ExpectationMatrix | Literal[0] | None)" (reportUnknownVariableType)
+     Type of "covariance" is "(X: Unknown, Y: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (CrossCovarianceMatrix | Covariance | Unknown | Basic | Expectation | Expr | tuple[Unknown, ...] | Sum | Self@Expr | Any | Zero | NaN | Piecewise | Equality | Integral | ExpectationMatrix | Literal[0] | None)" (reportUnknownVariableType)
-     Type of "entropy" is "(expr: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (int | Expr | Basic | Expectation | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Any | Add | Zero | NaN | Piecewise | Equality | Integral | ExpectationMatrix | None)" (reportUnknownVariableType)
+     Type of "entropy" is "(expr: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (int | Expr | Basic | Expectation | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Any | Zero | NaN | Piecewise | Equality | Integral | ExpectationMatrix | None)" (reportUnknownVariableType)
-     Type of "factorial_moment" is "(X: Unknown, n: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (Expr | Basic | Expectation | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Any | Add | Zero | NaN | Piecewise | Equality | Integral | ExpectationMatrix | Literal[0] | None)" (reportUnknownVariableType)
+     Type of "factorial_moment" is "(X: Unknown, n: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (Expr | Basic | Expectation | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Any | Zero | NaN | Piecewise | Equality | Integral | ExpectationMatrix | Literal[0] | None)" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:107:9 - warning: Return type, "tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Add | Zero | NaN | Piecewise | Basic | Equality | Integral | Literal[0] | None", is partially unknown (reportUnknownParameterType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:107:9 - warning: Return type, "tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | Integral | Literal[0] | None", is partially unknown (reportUnknownParameterType)
-     Type of "compute_expectation" is "(expr: Unknown, rvs: Unknown | None = None, **kwargs: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Add | Zero | NaN | Piecewise | Basic | Equality | Literal[0] | None)" (reportUnknownMemberType)
+     Type of "compute_expectation" is "(expr: Unknown, rvs: Unknown | None = None, **kwargs: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | Literal[0] | None)" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:113:20 - warning: Return type, "tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Add | Zero | NaN | Piecewise | Basic | Equality | Literal[0] | None", is partially unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:113:20 - warning: Return type, "tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | Literal[0] | None", is partially unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:116:9 - warning: Return type, "Unknown | Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Expr | Any | Add | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | NegativeInfinity | Float | Number", is partially unknown (reportUnknownParameterType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:116:9 - warning: Return type, "Unknown | Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Expr | Any | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | Number | NegativeInfinity", is partially unknown (reportUnknownParameterType)
-     Type of "probability" is "((condition: Unknown, **kwargs: Unknown) -> Unknown) | ((condition: Unknown) -> (Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Unknown | Sum | Expr | Any | Add | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | NegativeInfinity | Float | Number)) | ((condition: Unknown) -> (NaN | Unknown | Piecewise | Integer | Literal[0]))" (reportUnknownMemberType)
+     Type of "probability" is "((condition: Unknown, **kwargs: Unknown) -> Unknown) | ((condition: Unknown) -> (Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Unknown | Sum | Expr | Any | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | Number | NegativeInfinity)) | ((condition: Unknown) -> (NaN | Unknown | Piecewise | Integer | Literal[0]))" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:119:16 - warning: Return type, "Unknown | Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Expr | Any | Add | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | NegativeInfinity | Float | Number", is partially unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:119:16 - warning: Return type, "Unknown | Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Expr | Any | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | Number | NegativeInfinity", is partially unknown (reportUnknownVariableType)
-     Type of "expr" is "tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Add | Zero | NaN | Piecewise | Basic | Equality | Integral | None" (reportUnknownVariableType)
+     Type of "expr" is "tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | Integral | None" (reportUnknownVariableType)
-     Type of "_marginalise" is "(expr: Unknown, rv: Unknown, evaluate: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Add | Zero | NaN | Piecewise | Basic | Equality | Integral | None)" (reportUnknownMemberType)
+     Type of "_marginalise" is "(expr: Unknown, rv: Unknown, evaluate: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | Integral | None)" (reportUnknownMemberType)

... (truncated 3178 lines) ...

com2ann (https://github.com/ilevkivskyi/com2ann)
- File or directory "file:///tmp/mypy_primer/projects/com2ann/com2ann" does not exist.
+ File or directory "file:///tmp/mypy_primer/projects/com2ann/com2ann" does not exist

core (https://github.com/home-assistant/core)
-   /tmp/mypy_primer/projects/core/homeassistant/components/amcrest/camera.py:503:20 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/brother/__init__.py:30:12 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/brother/config_flow.py:104:16 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/brother/coordinator.py:35:16 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/goodwe/button.py:49:12 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/goodwe/number.py:101:16 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/goodwe/select.py:53:12 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/hassio/addon_manager.py:54:20 - error: "type[Unknown]" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/kaleidescape/__init__.py:33:12 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/kaleidescape/__init__.py:82:12 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/meater/__init__.py:41:12 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/nextdns/__init__.py:90:12 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/nextdns/config_flow.py:52:20 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/nextdns/config_flow.py:112:20 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/nextdns/coordinator.py:63:16 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/nextdns/switch.py:578:16 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/panasonic_viera/__init__.py:170:16 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/panasonic_viera/__init__.py:258:16 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/panasonic_viera/config_flow.py:63:20 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/panasonic_viera/config_flow.py:147:16 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/sharkiq/coordinator.py:81:16 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/yalexs_ble/__init__.py:98:12 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/yalexs_ble/config_flow.py:56:12 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/yeelight/__init__.py:217:12 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/yeelight/config_flow.py:291:16 - error: "ModuleType" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
- 26869 errors, 330230 warnings, 0 notes
+ 26844 errors, 330230 warnings, 0 notes

streamlit (https://github.com/streamlit/streamlit)
+   /tmp/mypy_primer/projects/streamlit/lib/streamlit/elements/lib/options_selector_utils.py:110:12 - warning: Unnecessary isinstance call; "type[E2@_coerce_enum]" is always an instance of "EnumMeta" (reportUnnecessaryIsInstance)
+   /tmp/mypy_primer/projects/streamlit/lib/streamlit/elements/lib/options_selector_utils.py:111:9 - warning: Code is unreachable (reportUnreachable)
- 5994 errors, 48917 warnings, 0 notes
+ 5994 errors, 48919 warnings, 0 notes

dd-trace-py (https://github.com/DataDog/dd-trace-py)
-   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/vendor/psutil/_psbsd.py:381:20 - error: "None" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/vendor/psutil/_psbsd.py:509:12 - error: "None" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/vendor/psutil/_psbsd.py:511:12 - error: "None" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/vendor/psutil/_psosx.py:252:16 - error: "None" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/vendor/psutil/_psosx.py:321:16 - error: "None" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/vendor/psutil/_psosx.py:323:16 - error: "None" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/vendor/psutil/_psosx.py:363:20 - error: "None" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/vendor/psutil/_pssunos.py:472:16 - error: "None" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/vendor/psutil/_pssunos.py:482:16 - error: "None" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/vendor/psutil/_pswindows.py:783:20 - error: "None" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
- 15032 errors, 149847 warnings, 0 notes
+ 15022 errors, 149847 warnings, 0 notes

attrs (https://github.com/python-attrs/attrs)
-   /tmp/mypy_primer/projects/attrs/src/attr/validators.py:613:16 - error: "_CountingAttr" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
- 1043 errors, 7098 warnings, 5 notes
+ 1042 errors, 7098 warnings, 5 notes

@DetachHead DetachHead merged commit ad60713 into main Dec 18, 2024
20 checks passed
@DetachHead DetachHead deleted the merge-1.1.391 branch December 18, 2024 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.1.391
3 participants