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
{{ message }}
Repository navigation
False positive on parenthezised del statements #5177
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=1b=2del (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.
Activity
shahhamdihassan commentedon Oct 14, 2026
Thanks for the report! This reproduces on main for both
del (a, b)anddel [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.Test a parenthesized target list in `del`
Accept a parenthesized target list in `del`
shahhamdihassan commentedon Oct 16, 2026
Thanks for the report! The fix has landed and will be in the next release.
sk- commentedon Nov 13, 2026
For anyone coming here, this is still not released and will be released in version 1.5.0