Skip to content

Conversation

BobTheBuidler
Copy link
Contributor

@BobTheBuidler BobTheBuidler commented Sep 16, 2025

to be honest I have no idea what this code does, but I know we need to fix it per advice from @hauntsaninja in #19846

(Explain how this PR changes mypy.)

to be honest I have no idea what this code does, but I know we need to fix it

This comment has been minimized.

@BobTheBuidler
Copy link
Contributor Author

Are these 2 changes proper?

=================================== FAILURES ===================================
_____________________________ testFinalValuesOnVar _____________________________
[gw0] linux -- Python 3.12.11 /home/runner/work/mypy/mypy/.tox/py/bin/python
data: /home/runner/work/mypy/mypy/test-data/unit/semanal-basic.test:489:
Failed: Invalid semantic analyzer output (/home/runner/work/mypy/mypy/test-data/unit/semanal-basic.test, line 489)
----------------------------- Captured stderr call -----------------------------
Expected:
  MypyFile:1(
    ImportFrom:1(typing, [Final, Any])
    FuncDef:3(
  ...
      NameExpr(True [builtins.True])
      Literal[True]?)
    AssignmentStmt:8(
      NameExpr(n* [__main__.n] = None) (diff)
      CallExpr:8(
        NameExpr(func [__main__.func])
        Args())))
Actual:
  MypyFile:1(
    ImportFrom:1(typing, [Final, Any])
    FuncDef:3(
  ...
      NameExpr(True [builtins.True])
      Literal[True]?)
    AssignmentStmt:8(
      NameExpr(n* [__main__.n]) (diff)
      CallExpr:8(
        NameExpr(func [__main__.func])
        Args())))

Alignment of first line difference:
  E:     NameExpr(n* [__main__.n] = None)
  A:     NameExpr(n* [__main__.n])
                                 ^
Update the test output using --update-data (implies -n0; you can additionally use the -k selector to update only specific tests)
_____________________________ testFinalValuesOnVar _____________________________
[gw3] linux -- Python 3.12.11 /home/runner/work/mypy/mypy/.tox/py/bin/python
data: /home/runner/work/mypy/mypy/test-data/unit/semanal-basic.test:489:
Failed: Invalid semantic analyzer output (/home/runner/work/mypy/mypy/test-data/unit/semanal-basic.test, line 489)
----------------------------- Captured stderr call -----------------------------
Expected:
  MypyFile:1(
    ImportFrom:1(typing, [Final, Any])
    FuncDef:3(
  ...
      NameExpr(True [builtins.True])
      Literal[True]?)
    AssignmentStmt:8(
      NameExpr(n* [__main__.n] = None) (diff)
      CallExpr:8(
        NameExpr(func [__main__.func])
        Args())))
Actual:
  MypyFile:1(
    ImportFrom:1(typing, [Final, Any])
    FuncDef:3(
  ...
      NameExpr(True [builtins.True])
      Literal[True]?)
    AssignmentStmt:8(
      NameExpr(n* [__main__.n]) (diff)
      CallExpr:8(
        NameExpr(func [__main__.func])
        Args())))

Alignment of first line difference:
  E:     NameExpr(n* [__main__.n] = None)
  A:     NameExpr(n* [__main__.n])
                                 ^
Update the test output using --update-data (implies -n0; you can additionally use the -k selector to update only specific tests)
=========================== short test summary info ============================
FAILED mypy/test/testsemanal.py::SemAnalSuite::semanal-basic.test::testFinalValuesOnVar
FAILED mypy/test/testtransform.py::TransformSuite::semanal-basic.test::testFinalValuesOnVar
===== 2 failed, 12827 passed, 366 skipped, 13 xfailed in 421.79s (0:07:01) =====

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, please update the tests output.

@BobTheBuidler
Copy link
Contributor Author

BobTheBuidler commented Sep 25, 2025 via email

Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@ilevkivskyi ilevkivskyi merged commit 19697af into python:master Sep 25, 2025
31 of 32 checks passed
@BobTheBuidler BobTheBuidler deleted the patch-8 branch September 26, 2025 01:28
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.

2 participants