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

add @override decorator when autocompleting overridden methods #1027

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

DetachHead
Copy link
Owner

fixes #509

@DetachHead DetachHead force-pushed the override-decorator-completion branch from 395d3ab to a853aad Compare January 29, 2025 13:33
@DetachHead DetachHead enabled auto-merge (rebase) January 29, 2025 13:34

This comment has been minimized.

@DetachHead DetachHead force-pushed the override-decorator-completion branch from a853aad to 3211822 Compare January 29, 2025 14:26
@DetachHead DetachHead merged commit adddb9d into main Jan 29, 2025
20 checks passed
@DetachHead DetachHead deleted the override-decorator-completion branch January 29, 2025 14:50
Copy link
Contributor

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

sympy (https://github.com/sympy/sympy)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:10:46 - warning: Type of "igcd" is partially unknown
-     Type of "igcd" is "_lru_cache_wrapper[Unknown]" (reportUnknownVariableType)
-     Type of "factor_list" is "(f: Unknown, ...) -> (tuple[ComplexInfinity | Rational | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown]] | tuple[ComplexInfinity | Rational | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown], list[tuple[Unknown, Unknown]] | list[Unknown]])" (reportUnknownVariableType)
+     Type of "factor_list" is "(f: Unknown, ...) -> Unknown" (reportUnknownVariableType)
-     Type of "equation" is "Unknown | Expr | Any | Self@Expr" (reportUnknownMemberType)
+     Type of "equation" is "Unknown | Expr | Any | Integer" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Integer)" (reportUnknownMemberType)
-     Type of "equation" is "Unknown | Expr | Any | Self@Expr" (reportUnknownMemberType)
+     Type of "equation" is "Unknown | Expr | Any | Integer" (reportUnknownMemberType)
-     Type of "equation" is "Unknown | Expr | Any | Self@Expr" (reportUnknownMemberType)
+     Type of "equation" is "Unknown | Expr | Any | Integer" (reportUnknownMemberType)
-     Type of "equation" is "Unknown | Expr | Any | Self@Expr" (reportUnknownMemberType)
+     Type of "equation" is "Unknown | Expr | Any | Integer" (reportUnknownMemberType)
-     Type of "equation" is "Unknown | Expr | Any | Self@Expr" (reportUnknownMemberType)
+     Type of "equation" is "Unknown | Expr | Any | Integer" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:354:22 - warning: Argument type is unknown
-     Argument corresponds to parameter "object" in function "append" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:358:17 - warning: Type of "gcd" is unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:361:29 - warning: Argument type is unknown
-     Argument corresponds to parameter "object" in function "insert" (reportUnknownArgumentType)
-     Type of "equation" is "Unknown | Expr | Any | Self@Expr" (reportUnknownMemberType)
+     Type of "equation" is "Unknown | Expr | Any | Integer" (reportUnknownMemberType)
+     Argument type is "Unknown | Expr | Any | Integer" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:551:17 - warning: Type of "g" is unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:552:17 - warning: Type of "a" is unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:553:17 - warning: Type of "c" is unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:556:29 - warning: Argument type is unknown
-     Argument corresponds to parameter "n" in function "isqrt" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:557:29 - warning: Argument type is unknown
-     Argument corresponds to parameter "n" in function "isqrt" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:561:21 - warning: Type of "eq" is unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:562:43 - warning: Argument type is unknown
-     Argument corresponds to parameter "f" in function "solveset_real" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:567:33 - warning: Argument type is unknown
-     Argument corresponds to parameter "x" in function "int_valued" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:576:39 - warning: Argument type is unknown
-     Argument corresponds to parameter "a" in function "divisible" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:577:39 - warning: Argument type is unknown
-     Argument corresponds to parameter "a" in function "divisible" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:597:21 - warning: Type of "x_0" is partially unknown
-     Type of "x_0" is "ComplexInfinity | Rational | Unknown" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:598:21 - warning: Type of "y_0" is partially unknown
-     Type of "y_0" is "ComplexInfinity | Rational | Unknown" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:603:26 - warning: Type of "is_Integer" is partially unknown
-     Type of "is_Integer" is "bool | Unknown" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:603:45 - warning: Type of "is_Integer" is partially unknown
-     Type of "is_Integer" is "bool | Unknown" (reportUnknownMemberType)
-     Type of "equation" is "Unknown | Expr | Any | Self@Expr" (reportUnknownMemberType)
+     Type of "equation" is "Unknown | Expr | Any | Integer" (reportUnknownMemberType)
+     Argument type is "Unknown | Expr | Any | Integer" (reportUnknownArgumentType)
-     Type of "x_n" is "Unknown | ComplexInfinity | Rational | None" (reportUnknownVariableType)
+     Type of "x_n" is "Unknown | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Infinity | NegativeInfinity | Float | _NotImplementedType | Expr | None" (reportUnknownVariableType)
-     Type of "y_n" is "Unknown | ComplexInfinity | Rational | None" (reportUnknownVariableType)
+     Type of "y_n" is "Unknown | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Infinity | NegativeInfinity | Float | _NotImplementedType | Expr | None" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:666:33 - warning: Type of "Xt" is partially unknown
-     Type of "Xt" is "ComplexInfinity | Rational | Unknown" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:667:33 - warning: Type of "Yt" is partially unknown
-     Type of "Yt" is "ComplexInfinity | Rational | Unknown" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1218:9 - warning: Type of "g" is unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1223:9 - warning: Type of "g" is unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1351:9 - warning: Type of "eq" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1351:9 - warning: Type of "eq" is unknown (reportUnknownVariableType)
-     Type of "eq" is "Unknown | Expr" (reportUnknownVariableType)
-     Type of "as_expr" is "(*gens: Unknown) -> (Unknown | Expr)" (reportUnknownMemberType)
+     Type of "as_expr" is "(*gens: Unknown) -> Unknown" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1352:16 - warning: Type of "is_polynomial" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1352:16 - warning: Type of "is_polynomial" is unknown (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1366:33 - warning: Argument type is unknown
+     Argument corresponds to parameter "eq" in function "classify_diop" (reportUnknownArgumentType)
-     Type of "terms" is "list[tuple[Unknown | Expr, int]]" (reportUnknownVariableType)
+     Type of "terms" is "list[tuple[Unknown, int]]" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1448:9 - warning: Type of "fl" is unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1448:9 - warning: Type of "fl" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1448:26 - warning: Argument type is unknown
-     Type of "fl" is "tuple[ComplexInfinity | Rational | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown]] | tuple[ComplexInfinity | Rational | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown], list[tuple[Unknown, Unknown]] | list[Unknown]]" (reportUnknownVariableType)
+     Argument corresponds to parameter "f" in function "factor_list" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1449:12 - warning: Type of "is_Rational" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1449:12 - warning: Type of "is_Rational" is unknown (reportUnknownMemberType)
-     Type of "is_Rational" is "bool | Unknown | Any" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1450:32 - warning: Argument type is unknown
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1451:9 - warning: Type of "terms" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1451:9 - warning: Type of "terms" is unknown (reportUnknownVariableType)
-     Type of "terms" is "list[tuple[Unknown, Unknown]] | list[Unknown]" (reportUnknownVariableType)

... (truncated 5589 lines) ...

black (https://github.com/psf/black): 13.89x slower (1.6s -> 21.9s in a single noisy sample)

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.

add @override when autocompleting an override
1 participant