You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug is probably the result of this line interpreting \[ bits from parse_test_data in mypy/test/data.py, which is then used by
_iter_fixes in mypy/test/update_data.py. Presumably these two pieces of logic are working at cross-purposes; One needs to interpret the test case to something Python can execute, and one needs to reproduce it exactly... If I'm right, the simple fix is simply escaping the bracket again as we output to fix lines. If I'm right, this also implies that test-style comments will disappear, which I guess we just haven't tested?
Activity
[-](馃悶) `--update-data` remove escapes[/-][+](馃悶) `--update-data` removes escapes[/+]wyattscarpenter commentedon Sep 24, 2025
This is especially annoying, I found out in #19923, when you're trying to make a
section. --update-data keeps ruining the dang config.
In case it helps diagnose the problems: I also discovered in https://github.com/python/mypy/pull/19904/files#diff-a359250205cd7c3fa369eb8557c577b353446e840f18a9fe46844232ab3c320fL1018 that it does the same thing with
transforming that into
But luckily that doesn't matter.
wyattscarpenter commentedon Sep 27, 2025
This bug is probably the result of this line interpreting
\[bits from parse_test_data in mypy/test/data.py, which is then used by_iter_fixes in mypy/test/update_data.py. Presumably these two pieces of logic are working at cross-purposes; One needs to interpret the test case to something Python can execute, and one needs to reproduce it exactly... If I'm right, the simple fix is simply escaping the bracket again as we output to fix lines. If I'm right, this also implies that test-style comments will disappear, which I guess we just haven't tested?