classification
Title: Improve error messages for multiple star expressions in assignment
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, furkanonder, pablogsal
Priority: normal Keywords: patch

Created on 2020-03-25 20:26 by furkanonder, last changed 2020-03-26 01:54 by pablogsal. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 19168 merged furkanonder, 2020-03-25 20:30
Messages (3)
msg365023 - (view) Author: Furkan Onder (furkanonder) * Date: 2020-03-25 20:26
Hello everyone,

>>> a,*b,*c,*d = range(4)
  File "<stdin>", line 1
SyntaxError: two starred expressions in assignment
>>> 

>>> a,*b,*c,*d,*e = range(5)
  File "<stdin>", line 1
SyntaxError: two starred expressions in assignment
>>> 

I think this error message is incomplete. It states that there are two starred assignments but there are more. It might be better if we change it to something less vague like "SyntaxError: more than one starred expressions in assignment."
msg365046 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-03-26 01:54
Thanks for the quick fix, Furkan! :)
msg365047 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-03-26 01:54
New changeset cb6534e1a8833b3f20bd88f52cf62a003426e855 by Furkan ├ľnder in branch 'master':
bpo-40067: Improve error messages for multiple star expressions in assignments (GH-19168)
https://github.com/python/cpython/commit/cb6534e1a8833b3f20bd88f52cf62a003426e855
History
Date User Action Args
2020-03-26 01:54:54pablogsalsetmessages: + msg365047
2020-03-26 01:54:51pablogsalsetstatus: open -> closed

nosy: + pablogsal
messages: + msg365046

resolution: fixed
stage: patch review -> resolved
2020-03-25 20:30:12furkanondersetkeywords: + patch
stage: patch review
pull_requests: + pull_request18527
2020-03-25 20:26:27furkanondercreate