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

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

Closed
adkabo opened this issue Dec 13, 2021 · 3 comments · Fixed by #42902
Closed

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

adkabo opened this issue Dec 13, 2021 · 3 comments · Fixed by #42902

Comments

@adkabo
Copy link
Contributor

adkabo commented Dec 13, 2021

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)
@martinholters
Copy link
Member

Similar to but not exactly duplicate of #42036.

@adkabo
Copy link
Contributor Author

adkabo commented Dec 13, 2021

Maybe #42036 can be for function signatures and this issue can have the smaller scope of only unpacking assignment.

# first position
(a..., b) = _
# interior position
(a, b..., c) = _

@simeonschaub
Copy link
Member

This is addressed by #42902, but that still needs to be finished up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants