This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2017年11月22日 23:31 by dacut, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 4509 | merged | dacut, 2017年11月22日 23:39 | |
| PR 9487 | merged | Jordan Chapman, 2018年09月22日 03:48 | |
| PR 9721 | merged | serhiy.storchaka, 2018年10月05日 17:52 | |
| PR 16994 | merged | python-dev, 2019年10月30日 13:06 | |
| PR 19737 | merged | python-dev, 2020年04月27日 18:01 | |
| Messages (17) | |||
|---|---|---|---|
| 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) * (Python committer) | 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 "<ipython-input-6-ba56159162e9>", 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) * (Python committer) | 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) * (Python committer) | 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) * (Python committer) | 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) * (Python committer) | 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) * (Python committer) | 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) * (Python committer) | 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 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:54 | admin | set | github: 76298 |
| 2020年05月05日 14:50:03 | miss-islington | set | messages: + msg368161 |
| 2020年04月27日 18:01:00 | python-dev | set | nosy:
+ python-dev pull_requests: + pull_request19059 |
| 2019年10月30日 13:06:24 | python-dev | set | pull_requests: + pull_request16520 |
| 2018年10月05日 18:18:03 | serhiy.storchaka | set | status: open -> closed stage: patch review -> resolved |
| 2018年10月05日 18:10:02 | serhiy.storchaka | set | messages: + msg327160 |
| 2018年10月05日 17:52:10 | serhiy.storchaka | set | stage: needs patch -> patch review pull_requests: + pull_request9105 |
| 2018年10月01日 20:25:59 | serhiy.storchaka | set | status: closed -> open messages: + msg326823 stage: resolved -> needs patch |
| 2018年09月23日 01:13:15 | miss-islington | set | nosy:
+ miss-islington messages: + msg326122 |
| 2018年09月22日 03:48:49 | Jordan Chapman | set | pull_requests: + pull_request8897 |
| 2018年09月22日 01:34:30 | gvanrossum | set | status: open -> closed resolution: fixed messages: + msg326064 stage: patch review -> resolved |
| 2018年09月22日 01:31:20 | gvanrossum | set | messages: + msg326063 |
| 2018年09月15日 22:45:15 | Jordan Chapman | set | messages: + msg325461 |
| 2018年09月15日 22:44:11 | Jordan Chapman | set | messages: + msg325460 |
| 2018年09月15日 22:34:31 | gvanrossum | set | messages: + msg325459 |
| 2018年09月15日 04:21:41 | Jordan Chapman | set | nosy:
+ Jordan Chapman messages: + msg325421 |
| 2018年09月14日 06:09:44 | gvanrossum | set | nosy:
+ gvanrossum messages: + msg325327 versions: + Python 3.8, - Python 3.7 |
| 2018年05月09日 09:54:55 | serhiy.storchaka | link | issue32626 superseder |
| 2017年11月29日 22:30:57 | dacut | set | messages: + msg307267 |
| 2017年11月29日 22:20:32 | dacut | set | messages: + msg307266 |
| 2017年11月29日 22:07:21 | cryvate | set | nosy:
+ cryvate messages: + msg307264 |
| 2017年11月29日 21:44:55 | dacut | set | messages: + msg307257 |
| 2017年11月23日 06:17:21 | serhiy.storchaka | set | versions: + Python 3.7, - Python 3.4, Python 3.5, Python 3.6 |
| 2017年11月23日 06:16:52 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg306783 |
| 2017年11月22日 23:39:10 | dacut | set | keywords:
+ patch stage: patch review pull_requests: + pull_request4446 |
| 2017年11月22日 23:31:49 | dacut | create | |