Conversation
|
With the latest mypy update, this test fails... but only with typeshed/test_cases/stdlib/builtins/check_dict.py Lines 52 to 54 in c402107 I can reproduce this locally with mypy 1.4 installed: typeshed>python tests/regr_test.py stdlib --platform win32 --python-version 3.7 3.8 3.9 3.10 3.11 3.12
Running mypy --platform win32 --python-version 3.7 on the standard library test cases... success
Running mypy --platform win32 --python-version 3.8 on the standard library test cases... success
Running mypy --platform win32 --python-version 3.9 on the standard library test cases... success
Running mypy --platform win32 --python-version 3.10 on the standard library test cases... success
Running mypy --platform win32 --python-version 3.11 on the standard library test cases... failure
test_cases\stdlib\builtins\check_dict.py:54: error:
Expression is of type "dict[Any, Any]", not "dict[str, str]" [assert-type]
assert_type(dict(string.split(".") for string in i3), Dict[str, str])
^
Running mypy --platform win32 --python-version 3.12 on the standard library test cases... failure
test_cases\stdlib\builtins\check_dict.py:54: error:
Expression is of type "dict[Any, Any]", not "dict[str, str]" [assert-type]
assert_type(dict(string.split(".") for string in i3), Dict[str, str])
^
Test completed with errorsAnybody have any idea why this might be?? I'm struggling to reproduce the issue in mypy playground: https://mypy-play.net/?mypy=latest&python=3.11&gist=7a359709f41eb7a8a26cc8e201dbae79 |
|
I bisected using an editable install of mypy to find the mypy commit that broke this test: Cc. @hauntsaninja |
|
Luckily this seems to be a typeshed-specific problem; most users of typeshed>mypy -c "reveal_type(dict(string.split('.') for string in ['a.b']))"
<string>:1: note: Revealed type is "builtins.dict[builtins.str, builtins.str]"
Success: no issues found in 1 source file
typeshed>mypy -c "reveal_type(dict(string.split('.') for string in ['a.b']))" --custom-typeshed-dir .
<string>:1: note: Revealed type is "builtins.dict[Any, Any]"
Success: no issues found in 1 source fileThis is presumably because typeshed |
|
I'll revert that mypy PR :-/ |
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Thank you for the 1.4.1 release! |
No description provided.