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

Added code to conform with the new checks mandated in the typing spec… #9757

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

erictraut
Copy link
Collaborator

… for @final and @override applied to an overload. This addresses #9747.

… for `@final` and `@override` applied to an overload. This addresses #9747.
Copy link
Contributor

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

steam.py (https://github.com/Gobot1234/steam.py)
+   /tmp/mypy_primer/projects/steam.py/steam/client.py:369:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload)
+   /tmp/mypy_primer/projects/steam.py/steam/client.py:381:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload)
- 8509 errors, 94 warnings, 0 informations 
+ 8511 errors, 94 warnings, 0 informations 

sympy (https://github.com/sympy/sympy)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/autowrap.py:1176:30 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/autowrap.py:1177:28 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/matchpy_connector.py:288:16 - error: Type "Basic" is not assignable to declared type "Expr"
-     "Basic" is not assignable to "Expr" (reportAssignmentType)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:54:33 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:54:39 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-     Attribute "label" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:55:54 - error: Cannot access attribute "label" for class "Basic"
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:55:63 - error: Cannot access attribute "label" for class "Basic"
-     Attribute "label" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:379:30 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:379:36 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:379:44 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:425:41 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:425:47 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:446:30 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:446:36 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:446:44 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:1105:30 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:1105:36 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:1105:44 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:1164:41 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:1164:47 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:1176:9 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:1177:9 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:1178:9 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:1232:30 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:1232:36 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:1232:44 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:1293:46 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen.py:1293:57 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen_julia.py:484:43 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen_julia.py:484:49 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen_julia.py:484:57 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen_julia.py:516:42 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen_julia.py:516:48 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen_julia.py:516:59 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen_octave.py:459:43 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen_octave.py:459:49 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen_octave.py:459:57 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen_octave.py:490:42 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen_octave.py:490:48 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_codegen_octave.py:490:59 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_lambdify.py:1125:28 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_lambdify.py:1138:29 - error: "__getitem__" method not defined on type "Basic" (reportIndexIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_matchpy_connector.py:120:18 - error: Argument of type "Equality | Unknown" cannot be assigned to parameter "expr" of type "Expr" in function "add"
+   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_matchpy_connector.py:120:18 - error: Argument of type "Equality | Unknown | Relational | Unequality | Integer" cannot be assigned to parameter "expr" of type "Expr" in function "add"
-     Type "Equality | Unknown" is not assignable to type "Expr"
+     Type "Equality | Unknown | Relational | Unequality | Integer" is not assignable to type "Expr"
-       "Equality" is not assignable to "Expr" (reportArgumentType)
+       "Relational" is not assignable to "Expr" (reportArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_matchpy_connector.py:123:18 - error: Argument of type "Equality | Unknown" cannot be assigned to parameter "expr" of type "Expr" in function "add"
+   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_matchpy_connector.py:123:18 - error: Argument of type "Equality | Unknown | Relational | Unequality | Integer" cannot be assigned to parameter "expr" of type "Expr" in function "add"
-     Type "Equality | Unknown" is not assignable to type "Expr"
+     Type "Equality | Unknown | Relational | Unequality | Integer" is not assignable to type "Expr"
-       "Equality" is not assignable to "Expr" (reportArgumentType)
+       "Relational" is not assignable to "Expr" (reportArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_matchpy_connector.py:126:9 - error: Argument of type "Equality | Unknown" cannot be assigned to parameter "expr" of type "Expr" in function "add"
+   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_matchpy_connector.py:126:9 - error: Argument of type "Equality | Unknown | Relational | Unequality | Integer" cannot be assigned to parameter "expr" of type "Expr" in function "add"
-     Type "Equality | Unknown" is not assignable to type "Expr"
+     Type "Equality | Unknown | Relational | Unequality | Integer" is not assignable to type "Expr"
-       "Equality" is not assignable to "Expr" (reportArgumentType)
+       "Relational" is not assignable to "Expr" (reportArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_matchpy_connector.py:132:9 - error: Argument of type "Equality | Unknown" cannot be assigned to parameter "expr" of type "Expr" in function "add"
+   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_matchpy_connector.py:132:9 - error: Argument of type "Equality | Unknown | Relational | Unequality | Integer" cannot be assigned to parameter "expr" of type "Expr" in function "add"
-     Type "Equality | Unknown" is not assignable to type "Expr"
+     Type "Equality | Unknown | Relational | Unequality | Integer" is not assignable to type "Expr"
-       "Equality" is not assignable to "Expr" (reportArgumentType)
+       "Relational" is not assignable to "Expr" (reportArgumentType)

... (truncated 143 lines) ...

@erictraut erictraut merged commit 48ea2a0 into main Jan 25, 2025
18 checks passed
@erictraut erictraut deleted the issue-9747 branch January 25, 2025 07:24
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 participant