-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Multi-value iteration without parens? #6484
Comments
I suspect it's possible, just tricky to parse since you can have |
It would also conflict with the proposed syntax for variableless for loops – #2675. |
On the other hand, I have often done this by accident and wished it worked. It's a toss up. |
I often wish this worked as well. |
This would only save you from typing two characters, so the main question for me is whether it makes the language less surprising / more consistent. Let's look at what Julia does outside of a loop. On the one hand, For me, it is a toss up, but I am leaning against it. |
+1 in favor of this working. It gives a certain Ruby-esque chic to the code. |
@stevengj, I think the fact that |
+1 in favor of this, coming from Python I often expect this to work - mandatory parenthesis appears to me as falsely suggesting something related to tuples |
I think this would be really nice to have as well. I always find myself making the mistake, getting a syntax error, then going back to add parentheses. |
Can be done at any point in the 1.x timeframe since it's a non-breaking change. |
I just ran into this issue and ended up here, as I was quite confused as to why what I wrote didn't work. I think it would be much more intuitive if the destructing syntax in a for loop was the same as outside of the for loop. Thus, I'd want "for k,v in t" to work just like "k,v =t" works. Consider this a +1. |
Currently, you have to specify parentheses around multiple values when iterators return multiple values (i.e. Dicts, DataFrame columns, etc.). It'd be great if you didn't have to. Was this explicit for some reason? I couldn't find a discussion on it.
The text was updated successfully, but these errors were encountered: