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

fix @override completion text edit being added to __init_subclass__ and metaclass members #1103

Merged
merged 2 commits into from
Feb 24, 2025

Conversation

DetachHead
Copy link
Owner

fixes #1072

@DetachHead DetachHead force-pushed the fix-override-completion branch 5 times, most recently from 2401f18 to 920c312 Compare February 24, 2025 11:48
@DetachHead DetachHead force-pushed the fix-override-completion branch 4 times, most recently from 7766ac0 to 53a7911 Compare February 24, 2025 12:30
@DetachHead DetachHead force-pushed the fix-override-completion branch from 3ef1b9c to 961bace Compare February 24, 2025 12:58
Copy link
Contributor

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

sympy (https://github.com/sympy/sympy)
-     Type of "eq" is "Unknown | Expr | Any | Integer | None" (reportUnknownVariableType)
+     Type of "eq" is "Unknown | None" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:128:19 - warning: Argument type is unknown
+     Argument corresponds to parameter "expr" in function "_mexpand" (reportUnknownArgumentType)
-     Type of "mainlog" is "log | Any | Unknown | None" (reportUnknownVariableType)
+     Type of "mainlog" is "Unknown | None" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:132:5 - warning: Type of "other" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:132:5 - warning: Type of "other" is unknown (reportUnknownVariableType)
-     Type of "other" is "Expr | Any | Unknown" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:132:13 - warning: Type of "subs" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:132:13 - warning: Type of "subs" is unknown (reportUnknownMemberType)
-     Type of "subs" is "Unknown | Overload[(arg1: Mapping[Basic | complex, Expr | complex], arg2: None = None) -> Expr, (arg1: Iterable[tuple[Basic | complex, Expr | complex]], arg2: None = None, **kwargs: Any) -> Expr, (arg1: Expr | complex, arg2: Expr | complex) -> Expr, (arg1: Mapping[Basic | complex, Basic | complex], arg2: None = None, **kwargs: Any) -> Basic, (arg1: Iterable[tuple[Basic | complex, Basic | complex]], arg2: None = None, **kwargs: Any) -> Basic, (arg1: Basic | complex, arg2: Basic | complex, **kwargs: Any) -> Basic] | Any" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:132:21 - warning: Argument type is partially unknown
-     Argument type is "log | Any | Unknown" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:134:9 - warning: Type of "eq" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:134:9 - warning: Type of "eq" is unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:134:14 - warning: Type of "subs" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:134:14 - warning: Type of "subs" is unknown (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:134:32 - warning: Argument type is partially unknown
-     Argument type is "log | Any | Unknown" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:134:41 - warning: Argument type is partially unknown
-     Argument corresponds to parameter "arg2" in function "subs"
-     Type of "args" is "Tuple[Expr] | Any | Unknown" (reportUnknownMemberType)
+     Type of "args" is "Unknown" (reportUnknownMemberType)
-     Type of "mainlog" is "Expr | Any | Unknown" (reportUnknownVariableType)
+     Type of "mainlog" is "Unknown" (reportUnknownVariableType)
-     Type of "args" is "Tuple[Expr] | Any | Unknown" (reportUnknownMemberType)
+     Type of "args" is "Unknown" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:138:17 - error: Operator "-" not supported for type "Basic | Any | Unknown" (reportOperatorIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:138:18 - warning: Type of "args" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:138:18 - warning: Type of "args" is unknown (reportUnknownMemberType)
-     Type of "args" is "tuple[Basic, ...] | Any | Unknown" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:139:9 - warning: Type of "eq" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:139:9 - warning: Type of "eq" is unknown (reportUnknownVariableType)
-     Type of "eq" is "Unknown" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:140:17 - warning: Type of "free_symbols" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:140:17 - warning: Type of "free_symbols" is unknown (reportUnknownMemberType)
-     Type of "free_symbols" is "Unknown | set[Basic] | Any" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:142:23 - warning: Argument type is unknown
+     Argument corresponds to parameter "arg" in function "_linab" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:143:23 - warning: Argument type is unknown
+     Argument corresponds to parameter "expr" in function "collect" (reportUnknownArgumentType)
-     Type of "logarg" is "Expr | Any | Unknown" (reportUnknownVariableType)
+     Type of "logarg" is "Expr | Unknown" (reportUnknownVariableType)
-     Type of "args" is "Tuple[Expr] | Any | Unknown" (reportUnknownMemberType)
+     Type of "args" is "Tuple[Expr] | Unknown" (reportUnknownMemberType)
-     Type of "eq" is "Unknown | Expr | Any" (reportUnknownVariableType)
+     Type of "eq" is "Unknown | Expr | Any | Self@Expr" (reportUnknownVariableType)
-     Type of "lhs" is "Unknown | Expr | Any" (reportUnknownVariableType)
+     Type of "lhs" is "Unknown | Expr | Any | Self@Expr" (reportUnknownVariableType)
-     Type of "lhs" is "Unknown | Expr | Any" (reportUnknownVariableType)
+     Type of "lhs" is "Unknown | Expr | Self@Expr | Any" (reportUnknownVariableType)
-     Type of "xreplace" is "Unknown | ((rule: Unknown) -> (Unknown | Expr)) | Any" (reportUnknownMemberType)
+     Type of "xreplace" is "Unknown | ((rule: Unknown) -> (Unknown | Expr)) | Any | ((rule: Unknown) -> (Unknown | Self@Expr))" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:460:9 - warning: Type of "f" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:460:9 - warning: Type of "f" is partially unknown
+     Type of "f" is "Unknown | Expr" (reportUnknownVariableType)
-     Type of "as_expr" is "(*gens: Unknown) -> Unknown" (reportUnknownMemberType)
+     Type of "as_expr" is "(*gens: Unknown) -> (Unknown | Expr)" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:463:34 - warning: Type of "subs" is unknown (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:463:34 - warning: Argument type is unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:463:34 - warning: Type of "subs" is partially unknown
-     Argument corresponds to parameter "rep" in function "__new__" (reportUnknownArgumentType)
+     Type of "subs" is "Unknown | Overload[(arg1: Mapping[Basic | complex, Expr | complex], arg2: None = None) -> Expr, (arg1: Iterable[tuple[Basic | complex, Expr | complex]], arg2: None = None, **kwargs: Any) -> Expr, (arg1: Expr | complex, arg2: Expr | complex) -> Expr, (arg1: Mapping[Basic | complex, Basic | complex], arg2: None = None, **kwargs: Any) -> Basic, (arg1: Iterable[tuple[Basic | complex, Basic | complex]], arg2: None = None, **kwargs: Any) -> Basic, (arg1: Basic | complex, arg2: Basic | complex, **kwargs: Any) -> Basic]" (reportUnknownMemberType)
-     Type of "a" is "Unknown | Expr | Any | Self@Expr | Self@Add | None" (reportUnknownVariableType)
+     Type of "a" is "Unknown | None" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:477:9 - warning: Type of "free" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:477:9 - warning: Type of "free" is unknown (reportUnknownVariableType)
-     Type of "free" is "Unknown | set[Basic] | Any" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:477:16 - warning: Type of "free_symbols" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/bivariate.py:477:16 - warning: Type of "free_symbols" is unknown (reportUnknownMemberType)
-     Type of "decompose" is "(f: Unknown, ...) -> (list[Unknown] | list[Unknown | Poly] | Unknown)" (reportUnknownVariableType)
+     Type of "decompose" is "(f: Unknown, ...) -> (list[Unknown | Expr] | list[Unknown | Poly] | Unknown)" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/decompogen.py:9:5 - warning: Return type, "list[Expr] | list[Function | Pow] | list[Expr | Basic] | list[Function | Pow | Basic] | Unknown | list[Min | Max | Basic] | list[Unknown | Max | Min | Basic] | list[Basic] | list[Unknown | Poly | Basic] | list[Min | Max] | list[Unknown | Max | Min] | list[Unknown] | list[Unknown | Poly]", is partially unknown (reportUnknownParameterType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/decompogen.py:9:5 - warning: Return type, "list[Expr] | list[Function | Pow] | list[Expr | Basic] | list[Function | Pow | Basic] | Unknown | list[Min | Max | Basic] | list[Unknown | Max | Min | Basic] | list[Basic] | list[Unknown | Expr | Basic] | list[Unknown | Poly | Basic] | list[Min | Max] | list[Unknown | Max | Min] | list[Unknown | Expr] | list[Unknown | Poly]", is partially unknown (reportUnknownParameterType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/decompogen.py:51:16 - warning: Return type, "list[Expr | Basic] | list[Function | Pow | Basic] | Unknown | list[Min | Max | Basic] | list[Unknown | Max | Min | Basic] | list[Basic] | list[Unknown | Poly | Basic]", is partially unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/decompogen.py:51:16 - warning: Return type, "list[Expr | Basic] | list[Function | Pow | Basic] | list[Basic] | Unknown | list[Min | Max | Basic] | list[Unknown | Max | Min | Basic] | list[Unknown | Expr | Basic] | list[Unknown | Poly | Basic]", is partially unknown (reportUnknownVariableType)

... (truncated 5574 lines) ...

imagehash (https://github.com/JohannesBuchner/imagehash)

@DetachHead DetachHead merged commit 3f850b8 into main Feb 24, 2025
20 checks passed
@DetachHead DetachHead deleted the fix-override-completion branch February 24, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant