Skip to content

Allow ... in non-final assignment locationΒ #43413

Closed
@adkabo

Description

It would be convenient to have more iterable unpacking.

Julia 1.7:

julia> x, (ys...) = (1,2,3,4);
julia> x, ys
(1, (2, 3, 4))
julia> x, (ys...), z = (1,2,3,4)
ERROR: syntax: invalid "..." on non-final assignment location "ys" around REPL[2]:1

Python (feature specification):

In [1]: x, *y, z = [1,2,3,4]

In [2]: x, y, z
Out[2]: (1, [2, 3], 4)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions