-
Notifications
You must be signed in to change notification settings - Fork 372
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
Implement PEP 448 Additional Unpacking Generalizations #1128
Comments
Hy would need its own syntax for this kind of thing. We are already used to doing similar things with reader macros and syntax quotes, I propose ;; hy --spy
=> [1 #*[2 3 4] 5 6 #*[7 8 9]]
[1, *[2, 3, 4], 5, 6, *[7, 8, 9]]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
=> {#:{1 10} #:{2 20} 3 30}
{**{1: 10}, **{2: 20}, 3: 30}
{1: 10, 2: 20, 3: 30} The |
I'm wondering if I should work on this, so we can get rid of |
An improved The unpacking generalizations, on the other hand, can be used multiple times per form. Like |
No, I mean making |
The Python unpacking generalizations can appear not just in function calls, but in tuple, list, set, and dictionary displays. (And they may also appear in comprehensions in the future.) So Hy would also need them in the equivalent special forms, but keywords aren't magic there--they're data. It seems a lot more consistent to me to use I'm also not certain how #1127 should look, but it seems like a similar idea, so it would be nice if they had common syntax. |
Good point.
I assumed you'd use the identical syntax, like |
See PEP 448 for what I'm talking about. See also #891.
The text was updated successfully, but these errors were encountered: