False positive on parenthezised del statements
Describe the Bug
del (a, b) is valid Python and runs fine, but pyrefly 1.3.2 reports it as an invalid target (unsupported-delete)
The following code shows the issue
a = 1
b = 2
del (a, b)
$ pyrefly check mre.py
ERROR Invalid target for `del` [unsupported-delete]
--> mre.py:3:5
|
3 | del (a, b)
| ^^^^^^
Expected: no error, same as del a, b. del [a, b] fails the same way; del (a) and del (x["k"]) are accepted.
This matters in practice because both ruff and black emit this form whenever the target list exceeds the line length.
Sandbox Link
https://pyrefly.org/sandbox/?project=v2.w1VkJgJtM4zJSwJSRqBkmaOgkaijkKSJ6WtlhQCIgALUAGB-BwZXeimwVAEGg15MnjKwQElVyCgpKSi20teHac8vStdPzdNPyU8u1kfRoa8AiuDEssRMcFmFapxCPjiWioHGUhLc6pDQVscX2OqgsAaqwBt-AA
(Only applicable for extension issues) IDE Information
No response
Thanks for the report! This reproduces on main for both del (a, b) and del [a, b], because pyrefly treated the parenthesized or bracketed list as one invalid target instead of deleting each name in it: https://pyrefly.org/sandbox/?project=v2.q8ZRZCbqKCQBixodBWABA0waaUDLDXUUjHQUjHUUTHQUTHUUzECpNUcBpFBBQVkhtaIAlBgV8sCpDCSjAdKtiSxXmldcWgDzfGpOaglUZTTIhlhCKvH6AwA A small fix is being prepared, and this will close once it lands.
Thanks for the report! The fix has landed and will be in the next release.
For anyone coming here, this is still not released and will be released in version 1.5.0