msg306761 - (view) |
Author: David Cuthbert (dacut) * |
Date: 2017-11-22 23:31 |
This stems from a query on StackOverflow: https://stackoverflow.com/questions/47272460/python-tuple-unpacking-in-return-statement/ Specifically, the following syntax is allowed: def f(): rest = (4, 5, 6) t = 1, 2, 3, *rest While the following result in SyntaxError: def g(): rest = (4, 5, 6) return 1, 2, 3, *rest def h(): rest = (4, 5, 6) yield 1, 2, 3, *rest Looking at the original commit that enabled tuple unpacking in assignment statements: https://github.com/python/cpython/commit/4905e80c3d2f6abb613d212f0313d1dfe09475dc I don't believe this difference is intentional. My GitHub repo incorporates a fix for this; I'll file a pull request momentarily. |
|
|
msg306783 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2017-11-23 06:16 |
Since this changes the grammar, it should be first discussed on Python-Dev and approved by BDFL. |
|
|
msg307257 - (view) |
Author: David Cuthbert (dacut) * |
Date: 2017-11-29 21:44 |
CLA processed, and BDFL has assented on python-dev. Serhiy, thoughts on next steps? |
|
|
msg307264 - (view) |
Author: Henk-Jaap Wagenaar (cryvate) * |
Date: 2017-11-29 22:07 |
I think the language spec needs updating as well? In particular in https://docs.python.org/3/reference/simple_stmts.html#the-return-statement it seems expression_list should be replaced by starred_list. |
|
|
msg307266 - (view) |
Author: David Cuthbert (dacut) * |
Date: 2017-11-29 22:20 |
Hm... that leaves the only production for expression_list as: subscription ::= primary "[" expression_list "]" And I'm not sure that this shouldn't also be replaced by starred_list. It's not accepted today, though: In [6]: a[1,*(4, 5, 6)] File "", line 1 a[1,*(4, 5, 6)] ^ SyntaxError: invalid syntax I will ask about this again on python-dev@ |
|
|
msg307267 - (view) |
Author: David Cuthbert (dacut) * |
Date: 2017-11-29 22:30 |
Oops, I wasn't looking broadly enough. This is also used in the augmented assignment statements syntax, e.g. a += 1, 2, 3 |
|
|
msg325327 - (view) |
Author: Guido van Rossum (gvanrossum) *  |
Date: 2018-09-14 06:09 |
Move to 3.8. |
|
|
msg325421 - (view) |
Author: Jordan Chapman (Jordan Chapman) * |
Date: 2018-09-15 04:21 |
BFDL approval: https://mail.python.org/pipermail/python-dev/2017-November/150842.html |
|
|
msg325459 - (view) |
Author: Guido van Rossum (gvanrossum) *  |
Date: 2018-09-15 22:34 |
Jordan, what's your GitHub account name? I hope you can check this out and make the changes I'm requesting on GitHub. |
|
|
msg325460 - (view) |
Author: Jordan Chapman (Jordan Chapman) * |
Date: 2018-09-15 22:44 |
Here's my GitHub account: I'll make the changes and rebase as soon as I get home. |
|
|
msg325461 - (view) |
Author: Jordan Chapman (Jordan Chapman) * |
Date: 2018-09-15 22:45 |
Sorry, I could have sworn that I pasted my link... https://github.com/jChapman |
|
|
msg326063 - (view) |
Author: Guido van Rossum (gvanrossum) *  |
Date: 2018-09-22 01:31 |
New changeset fd97d1f1af910a6222ea12aec42c456b64f9aee4 by Guido van Rossum (David Cuthbert) in branch 'master': bpo-32117: Allow tuple unpacking in return and yield statements (gh-4509) https://github.com/python/cpython/commit/fd97d1f1af910a6222ea12aec42c456b64f9aee4 |
|
|
msg326064 - (view) |
Author: Guido van Rossum (gvanrossum) *  |
Date: 2018-09-22 01:34 |
Fixed by https://github.com/python/cpython/pull/4509. |
|
|
msg326122 - (view) |
Author: miss-islington (miss-islington) |
Date: 2018-09-23 01:13 |
New changeset 8fabae3b00b2ccffd9f7bf4736734ae584ac5829 by Miss Islington (bot) (jChapman) in branch 'master': bpo-32117: Iterable unpacking in return and yield documentation (GH-9487) https://github.com/python/cpython/commit/8fabae3b00b2ccffd9f7bf4736734ae584ac5829 |
|
|
msg326823 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2018-10-01 20:25 |
assertEquals() is deprecated, use assertEqual() instead. This causes tests failure when run with -Werror. |
|
|
msg327160 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2018-10-05 18:10 |
New changeset 4642d5f59828e774585e9895b538b24d71b9df8e by Serhiy Storchaka in branch 'master': Use assertEqual() instead of assertEquals(). (GH-9721) https://github.com/python/cpython/commit/4642d5f59828e774585e9895b538b24d71b9df8e |
|
|
msg368161 - (view) |
Author: miss-islington (miss-islington) |
Date: 2020-05-05 14:50 |
New changeset 627f7012353411590434a7d5777ddcbcc8d97fcd by Javier Buzzi in branch 'master': bpo-32117: Updated Simpsons names in docs (GH-19737) https://github.com/python/cpython/commit/627f7012353411590434a7d5777ddcbcc8d97fcd |
|
|