Skip to content

fix: something Shantanu found - #19859

Merged
ilevkivskyi merged 2 commits into
python:masterfrom
BobTheBuidler:patch-8
Sep 25, 2025
Merged

ilevkivskyi merged 2 commits into
python:masterfrom
BobTheBuidler:patch-8

Conversation

@BobTheBuidler

@BobTheBuidler BobTheBuidler commented Sep 16, 2025 •

Copy link
Copy Markdown
Contributor

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
@github-actions

This comment has been minimized.

@BobTheBuidler

Copy link
Copy Markdown
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) =====

@ilevkivskyi ilevkivskyi left a comment •

Copy link
Copy Markdown
Member

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

BobTheBuidler commented Sep 25, 2025 via email

Copy link
Copy Markdown
Contributor Author
@github-actions

Copy link
Copy Markdown
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
@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

2 participants