FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: something Shantanu found by BobTheBuidler · Pull Request #19859 · python/mypy · GitHub

Repository navigation

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 commented Sep 16, 2025 •
edited
Loading

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

This comment has been minimized.

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 left a comment •
edited
Loading

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Oh, please update the tests output.

BobTheBuidler commented Sep 25, 2025 via email

Copy link
Copy Markdown
Contributor Author

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 merged commit 19697af into python:master Sep 25, 2025
31 of 32 checks passed
BobTheBuidler deleted the patch-8 branch September 26, 2025 01:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL