[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2021-01-02 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2021-01-02 Thread miss-islington
miss-islington added the comment: New changeset 9a608ac17c284008d3c2986a4a8b194f84488e56 by Lysandros Nikolaou in branch '3.9': [3.9] bpo-40631: Disallow single parenthesized star target (GH-24027) (GH-24068) https://github.com/python/cpython/commit/9a608ac17c284008d3c2986a4a8b194f84488e56

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2021-01-02 Thread Lysandros Nikolaou
Change by Lysandros Nikolaou : -- pull_requests: +22901 pull_request: https://github.com/python/cpython/pull/24068 ___ Python tracker ___

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2021-01-02 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: New changeset 2ea320553298038bb7d6789e50e199332f66 by Lysandros Nikolaou in branch 'master': bpo-40631: Disallow single parenthesized star target (GH-24027) https://github.com/python/cpython/commit/2ea320553298038bb7d6789e50e199332f66

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-31 Thread Lysandros Nikolaou
Change by Lysandros Nikolaou : -- pull_requests: +22867 pull_request: https://github.com/python/cpython/pull/24027 ___ Python tracker ___

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-30 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +22859 pull_request: https://github.com/python/cpython/pull/24019 ___ Python tracker ___

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > I'll work on finding out when this got messed up and fix it. Apparently is commit bca701403253379409dece03053dbd739c0bd059 (HEAD) Author: Lysandros Nikolaou Date: Tue Oct 27 00:42:04 2020 +0200 bpo-42123: Run the parser two times and only

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-30 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: Yup, this all sounds much more reasonable. Thanks for the explanation, Guido. > Also the current behavior allows `(*x), y = 1` assignment. If `(*x)` is to be > totally disallowed, `(*x), y = 1` should also be rejected. This is allowed in 3.9.1 and

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-30 Thread Guido van Rossum
Guido van Rossum added the comment: > It makes sense to me to be able to do `(*a), b` if I can do `*a, b`, but I > don't really have a strong opinion on it. I disagree. *a is not an expression, so the normal rules for parenthesizing those don't apply. I've always thought of *a as a feature

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-30 Thread Saiyang Gou
Saiyang Gou added the comment: Also the current behavior allows `(*x), y = 1` assignment. If `(*x)` is to be totally disallowed, `(*x), y = 1` should also be rejected. -- ___ Python tracker

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Parenthesis can be added around expression. But `*a` is not an expression (as well as `+`, `or`, `1:5`, you cannot surround them with parenthesis). -- nosy: +serhiy.storchaka ___ Python tracker

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-30 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: It makes sense to me to be able to do `(*a), b` if I can do `*a, b`, but I don't really have a strong opinion on it. -- ___ Python tracker

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-30 Thread Guido van Rossum
Guido van Rossum added the comment: Honestly this seems like a bug in 3.8 to me (if it indeed behaves like this): >>> (*x), y (1, 2, 3) Every time I mistakenly tried (*x) I really meant (*x,), so it's surprising that (*x), y would be interpreted as (*x, y) rather than flagging (*x) as an

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-30 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +22855 pull_request: https://github.com/python/cpython/pull/24015 ___ Python tracker ___

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-30 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +22854 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/24014 ___ Python tracker

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-30 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: not a bug -> status: closed -> open ___ Python tracker ___ ___ Python-bugs-list

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-30 Thread Saiyang Gou
Saiyang Gou added the comment: Well, there is actually a bug: root@f1b4a742d8fc:/# python3.9 Python 3.9.1 (default, Dec 8 2020, 03:24:52) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> x = [1, 2] >>> y = 3 >>> *x, y (1, 2, 3) >>> (*x), y

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-05-15 Thread Lysandros Nikolaou
Change by Lysandros Nikolaou : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-05-15 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: Whoops, false alarm. It's just that we moved the check for invalid starred expressions to the parser, while it previously was in the compiler. ╰─ ./python.exe -X oldparser Python 3.9.0a6+ (heads/master-dirty:003708bcf8, May 15 2020, 15:08:21) [Clang

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-05-15 Thread Lysandros Nikolaou
New submission from Lysandros Nikolaou : The new PEG parser fails when a parenthesised expression with a single child (a group) contains a starred expression. Example: ╰─ ./python.exe Python 3.9.0a6+ (heads/master-dirty:4a12d12186, May 15 2020, 14:53:45) [Clang 11.0.0 (clang-1100.0.33.8)] on