Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messages for multiple star expressions in assignment #84248

Closed
furkanonder mannequin opened this issue Mar 25, 2020 · 3 comments
Closed

Improve error messages for multiple star expressions in assignment #84248

furkanonder mannequin opened this issue Mar 25, 2020 · 3 comments
Labels
3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@furkanonder
Copy link
Mannequin

furkanonder mannequin commented Mar 25, 2020

BPO 40067
Nosy @pablogsal, @isidentical, @furkanonder
PRs
  • bpo-40067 : Improve error messages for multiple star expressions in assignment #19168
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-03-26.01:54:51.193>
    created_at = <Date 2020-03-25.20:26:27.505>
    labels = ['interpreter-core', 'type-feature', '3.9']
    title = 'Improve error messages for multiple star expressions in assignment'
    updated_at = <Date 2020-03-26.01:54:54.306>
    user = 'https://github.com/furkanonder'

    bugs.python.org fields:

    activity = <Date 2020-03-26.01:54:54.306>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-03-26.01:54:51.193>
    closer = 'pablogsal'
    components = ['Interpreter Core']
    creation = <Date 2020-03-25.20:26:27.505>
    creator = 'furkanonder'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40067
    keywords = ['patch']
    message_count = 3.0
    messages = ['365023', '365046', '365047']
    nosy_count = 3.0
    nosy_names = ['pablogsal', 'BTaskaya', 'furkanonder']
    pr_nums = ['19168']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue40067'
    versions = ['Python 3.9']

    @furkanonder
    Copy link
    Mannequin Author

    furkanonder mannequin commented Mar 25, 2020

    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."

    @furkanonder furkanonder mannequin added 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Mar 25, 2020
    @pablogsal
    Copy link
    Member

    Thanks for the quick fix, Furkan! :)

    @pablogsal
    Copy link
    Member

    New changeset cb6534e by Furkan Önder in branch 'master':
    bpo-40067: Improve error messages for multiple star expressions in assignments (GH-19168)
    cb6534e

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant