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.396 #1115

Merged
merged 9 commits into from
Mar 1, 2025
Merged

Merge 1.1.396 #1115

merged 9 commits into from
Mar 1, 2025

Conversation

DetachHead
Copy link
Owner

No description provided.

bschnurr and others added 9 commits February 26, 2025 14:54
…eterized by a protocol that matches a module. This addresses #9988. (#9989)
* do not use sliced string for identifier and comment rules

* fixed prettier issue
…s involving the evaluation of a call whose target signature involves a parameter with a default argument value, notably where the type of the default value isn't assignable to the declared type of its parameter. This addresses #9901. (#9922)"

This reverts commit f873dbf.
# Conflicts:
#	.github/workflows/validation.yml
#	lerna.json
#	packages/pyright-internal/package-lock.json
#	packages/pyright-internal/src/analyzer/typeEvaluator.ts
#	packages/pyright-internal/src/localization/package.nls.ru.json
#	packages/pyright-internal/src/localization/package.nls.zh-cn.json
#	packages/pyright/package-lock.json
#	packages/pyright/package.json
#	packages/vscode-pyright/package-lock.json
#	packages/vscode-pyright/package.json
…ain cases involving the evaluation of a call whose target signature involves a parameter with a default argument value, notably where the type of the default value isn't assignable to the declared type of its parameter. This addresses #9901. (#9922)""

This reverts commit 07668ef

my fix addresses both the original issue and the issue caused by the fix, so we revert the reverting of the original commit (only tests here because my fix is in 6187f24)
Copy link
Contributor

github-actions bot commented Mar 1, 2025

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

sympy (https://github.com/sympy/sympy)
-     Type of "constant_renumber" is "(expr: Unknown, variables: Unknown | None = None, newconstants: Unknown | None = None) -> (list[Unknown] | set[Unknown] | tuple[Unknown, ...] | Boolean | Expr | Basic | Unknown)" (reportUnknownVariableType)
+     Type of "constant_renumber" is "(expr: Unknown, variables: Unknown | None = None, newconstants: Unknown | None = None) -> (list[Unknown] | set[Unknown] | tuple[Unknown, ...] | Boolean | Basic | Unknown)" (reportUnknownVariableType)
-     Type of "i" is "Equality | Unknown | Relational | Unequality | Integer" (reportUnknownVariableType)
+     Type of "i" is "Equality | Unknown" (reportUnknownVariableType)
-     Type of "decompogen" is "(f: Unknown, symbol: Unknown) -> (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[Expr | Unknown | Basic] | list[Unknown | Poly | Basic] | list[Min | Max] | list[Unknown | Max | Min] | list[Expr | Unknown] | list[Unknown | Poly])" (reportUnknownVariableType)
+     Type of "decompogen" is "(f: Unknown, symbol: Unknown) -> (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])" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_decompogen.py:23:31 - warning: Return type of lambda, "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[Expr | Unknown | Basic] | list[Unknown | Poly | Basic] | list[Min | Max] | list[Unknown | Max | Min] | list[Expr | Unknown] | list[Unknown | Poly]", is partially unknown (reportUnknownLambdaType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_decompogen.py:23:31 - warning: Return type of lambda, "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 (reportUnknownLambdaType)
-     Type of "rootof" is "(f: Unknown, x: Unknown, index: Unknown | None = None, radicals: bool = True, expand: bool = True) -> (Unknown | One | NegativeOne | Zero | Integer | Rational | NaN | ComplexInfinity | Half | Expr)" (reportUnknownVariableType)
+     Type of "rootof" is "(f: Unknown, x: Unknown, index: Unknown | None = None, radicals: bool = True, expand: bool = True) -> (Unknown | One | NegativeOne | Zero | Integer | Rational | NaN | ComplexInfinity | Half | Infinity | NegativeInfinity | Float | _NotImplementedType | Expr)" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_inequalities.py:134:9 - warning: Type of "inf" is partially unknown
-     Type of "inf" is "One | NegativeOne | Zero | Integer | Rational | NaN | ComplexInfinity | Half | Unknown" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_inequalities.py:137:16 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "args" in function "__new__"
+     Argument type is "Equality | Unknown" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_inequalities.py:137:16 - error: Argument of type "Equality | Unknown | Relational | Unequality | Integer" cannot be assigned to parameter "args" of type "Boolean | bool" in function "__new__"
-     Type "Equality | Unknown | Relational | Unequality | Integer" is not assignable to type "Boolean | bool"
-       Type "Integer" is not assignable to type "Boolean | bool"
-         "Integer" is not assignable to "Boolean"
-         "Integer" is not assignable to "bool" (reportArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_inequalities.py:137:29 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "args" in function "__new__"
+     Argument type is "Equality | Unknown" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_inequalities.py:137:29 - error: Argument of type "Equality | Unknown | Relational | Unequality | Integer" cannot be assigned to parameter "args" of type "Boolean | bool" in function "__new__"
-     Type "Equality | Unknown | Relational | Unequality | Integer" is not assignable to type "Boolean | bool"
-       Type "Integer" is not assignable to type "Boolean | bool"
-         "Integer" is not assignable to "Boolean"
-         "Integer" is not assignable to "bool" (reportArgumentType)
-     Type of "e" is "Equality | Unknown | Relational | Unequality | Integer | NaN | Sum" (reportUnknownVariableType)
+     Type of "e" is "Equality | Unknown | NaN | Sum" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_inequalities.py:287:12 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "args" in function "__new__"
+     Argument type is "Equality | Unknown" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_inequalities.py:287:12 - error: Argument of type "Equality | Unknown | Relational | Unequality | Integer" cannot be assigned to parameter "args" of type "Boolean | bool" in function "__new__"
-     Type "Equality | Unknown | Relational | Unequality | Integer" is not assignable to type "Boolean | bool"
-       Type "Integer" is not assignable to type "Boolean | bool"
-         "Integer" is not assignable to "Boolean"
-         "Integer" is not assignable to "bool" (reportArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_inequalities.py:287:22 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "args" in function "__new__"
+     Argument type is "Equality | Unknown" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_inequalities.py:287:22 - error: Argument of type "Equality | Unknown | Relational | Unequality | Integer" cannot be assigned to parameter "args" of type "Boolean | bool" in function "__new__"
-     Type "Equality | Unknown | Relational | Unequality | Integer" is not assignable to type "Boolean | bool"
-       Type "Integer" is not assignable to type "Boolean | bool"
-         "Integer" is not assignable to "Boolean"
-         "Integer" is not assignable to "bool" (reportArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_inequalities.py:297:79 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "args" in function "__new__"
+     Argument type is "Equality | Unknown" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_inequalities.py:297:79 - error: Argument of type "Equality | Unknown | Relational | Unequality | Integer" cannot be assigned to parameter "args" of type "Boolean | bool" in function "__new__"
-     Type "Equality | Unknown | Relational | Unequality | Integer" is not assignable to type "Boolean | bool"
-       Type "Integer" is not assignable to type "Boolean | bool"
-         "Integer" is not assignable to "Boolean"
-         "Integer" is not assignable to "bool" (reportArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_inequalities.py:297:89 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "args" in function "__new__"
+     Argument type is "Equality | Unknown" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_inequalities.py:297:89 - error: Argument of type "Equality | Unknown | Relational | Unequality | Integer" cannot be assigned to parameter "args" of type "Boolean | bool" in function "__new__"
-     Type "Equality | Unknown | Relational | Unequality | Integer" is not assignable to type "Boolean | bool"
-       Type "Integer" is not assignable to type "Boolean | bool"
-         "Integer" is not assignable to "Boolean"
-         "Integer" is not assignable to "bool" (reportArgumentType)
-     Type of "r" is "Unknown | One | NegativeOne | Zero | Integer | Rational | NaN | ComplexInfinity | Half | Expr" (reportUnknownVariableType)
+     Type of "r" is "Unknown | One | NegativeOne | Zero | Integer | Rational | NaN | ComplexInfinity | Half | Infinity | NegativeInfinity | Float | _NotImplementedType | Expr" (reportUnknownVariableType)
-     Type of "ie" is "Equality | Unknown | Relational | Unequality | Integer" (reportUnknownVariableType)
+     Type of "ie" is "Equality | Unknown" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_inequalities.py:459:13 - warning: Type of "e" is partially unknown
-     Type of "e" is "Any | _NotImplementedType | StrictGreaterThan | Unknown | Equality | Relational | Unequality | Integer" (reportUnknownVariableType)
-     Type of "e" is "Equality | Unknown | Relational | Unequality | Integer" (reportUnknownVariableType)
+     Type of "e" is "Equality | Unknown" (reportUnknownVariableType)
-     Type of "eq" is "Equality | Unknown | Relational | Unequality | Integer" (reportUnknownVariableType)
+     Type of "eq" is "Equality | Unknown" (reportUnknownVariableType)
-     Type of "eq" is "Equality | Unknown | Relational | Unequality | Integer" (reportUnknownVariableType)
+     Type of "eq" is "Equality | Unknown" (reportUnknownVariableType)
-     Type of "eq" is "Equality | Unknown | Relational | Unequality | Integer" (reportUnknownVariableType)
+     Type of "eq" is "Equality | Unknown" (reportUnknownVariableType)

... (truncated 4806 lines) ...

jinja (https://github.com/pallets/jinja)

spack (https://github.com/spack/spack)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/forward-multi-value/package.py:19:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/forward-multi-value/package.py:19:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/gcc/package.py:26:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/gcc/package.py:26:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/gmt/package.py:14:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/gmt/package.py:14:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/hdf5/package.py:17:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/hdf5/package.py:17:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/hpcviewer/package.py:15:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/hpcviewer/package.py:15:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/hpcviewer/package.py:16:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/hpcviewer/package.py:16:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/hypre/package.py:18:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/hypre/package.py:18:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/hypre/package.py:19:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/hypre/package.py:19:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/indirect-mpich/package.py:18:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/indirect-mpich/package.py:19:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/indirect-mpich/package.py:18:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/indirect-mpich/package.py:19:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/installed-deps-a/package.py:25:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/installed-deps-a/package.py:26:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/installed-deps-a/package.py:25:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/installed-deps-a/package.py:26:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/installed-deps-b/package.py:25:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/installed-deps-b/package.py:26:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/installed-deps-b/package.py:25:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/installed-deps-b/package.py:26:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/installed-deps-c/package.py:25:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/installed-deps-c/package.py:26:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/installed-deps-c/package.py:25:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/installed-deps-c/package.py:26:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/leaf-adds-virtual/package.py:14:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/leaf-adds-virtual/package.py:14:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/libdwarf/package.py:21:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin.mock/packages/libdwarf/package.py:21:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)

... (truncated 342 lines) ...

arviz (https://github.com/arviz-devs/arviz)

@DetachHead DetachHead merged commit d656df1 into main Mar 1, 2025
20 checks passed
@DetachHead DetachHead deleted the merge-1.1.396 branch March 1, 2025 01:29
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.

5 participants