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
is allowed on Python 3.7 and 3.8 but not on 3.9 while working on #16485 and then again on #16558.
We actually already emit a normal parse error for this, so the change I guess we'd need is more like skipping the existing ParseError based on the version rather than adding an UnsupportedSyntaxError.
On the other hand, this only affects Python versions before 3.9, which are no longer supported. I'm leaning toward just removing this from #6591 and considering it finished without this check, but I wanted to get some other thoughts on this too.
That approach also raises the question of whether we should have taken the same approach with the parenthesized keyword argument names in #16482. That's the only other example of removed syntax in #6591, unless I'm missing another case in my unmerged PRs. We could just emit a ParseError for that and not worry about removed syntax for versions before 3.9.
For the partial unpacking case, specifically, I also didn't find any documentation about that change, so I think it just fell out of the PEG parser change in 3.9.
The text was updated successfully, but these errors were encountered:
ntBre
changed the title
def i(): return 1, (*rest) is no longer allowed (something with *rest)
Partial unpacking in return, yield, and for before Python 3.9
Mar 7, 2025
I made this a sub-issue of #6591 for easier discussion, but I ran into the fact that syntax like this:
is allowed on Python 3.7 and 3.8 but not on 3.9 while working on #16485 and then again on #16558.
We actually already emit a normal parse error for this, so the change I guess we'd need is more like skipping the existing
ParseError
based on the version rather than adding anUnsupportedSyntaxError
.On the other hand, this only affects Python versions before 3.9, which are no longer supported. I'm leaning toward just removing this from #6591 and considering it finished without this check, but I wanted to get some other thoughts on this too.
That approach also raises the question of whether we should have taken the same approach with the parenthesized keyword argument names in #16482. That's the only other example of removed syntax in #6591, unless I'm missing another case in my unmerged PRs. We could just emit a
ParseError
for that and not worry about removed syntax for versions before 3.9.For the partial unpacking case, specifically, I also didn't find any documentation about that change, so I think it just fell out of the PEG parser change in 3.9.
The text was updated successfully, but these errors were encountered: