Skip to content

Added generalized support for assignment expressions (walrus operator… #10150

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

Merged
merged 1 commit into from
Mar 23, 2025

Conversation

erictraut
Copy link
Collaborator

…s) for type guards. This addresses #10149.

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/utilities/tests/test_matchpy_connector.py:120:70 - error: Argument of type "list[Unequality | Integer]" cannot be assigned to parameter "conditions_nonfalse" of type "List[Expr]" in function "add"
+   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_matchpy_connector.py:120:70 - error: Argument of type "list[Unequality | Unknown | Equality | Relational]" cannot be assigned to parameter "conditions_nonfalse" of type "List[Expr]" in function "add"
-     Type "Unequality | Integer" is not assignable to type "Expr"
+     Type "Unequality | Unknown | Equality | Relational" is not assignable to type "Expr"
-       "Unequality" is not assignable to "Expr"
+       "Relational" is not assignable to "Expr"
-     Type "Unequality | Integer" is not assignable to type "Expr"
+     Type "Unequality | Unknown | Equality | Relational" is not assignable to type "Expr"
-       "Unequality" is not assignable to "Expr"
+       "Relational" is not assignable to "Expr"
-     Type "Unequality | Integer" is not assignable to type "Expr"
+     Type "Unequality | Unknown | Equality | Relational" is not assignable to type "Expr"
-       "Unequality" is not assignable to "Expr"
+       "Relational" is not assignable to "Expr"
-     Type "Unequality | Integer" is not assignable to type "Expr"
+     Type "Unequality | Unknown | Equality | Relational" is not assignable to type "Expr"
-       "Unequality" is not assignable to "Expr" (reportArgumentType)
+       "Relational" is not assignable to "Expr" (reportArgumentType)

core (https://github.com/home-assistant/core)
-   /tmp/mypy_primer/projects/core/homeassistant/components/conversation/chat_log.py:54:24 - error: Cannot access attribute "content" for class "ToolResultContent"
-     Attribute "content" is unknown (reportAttributeAccessIssue)
- 66985 errors, 290 warnings, 0 informations 
+ 66984 errors, 290 warnings, 0 informations 

@erictraut erictraut merged commit ef98f17 into main Mar 23, 2025
18 checks passed
@erictraut erictraut deleted the issue-10149 branch March 23, 2025 04:11
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