Yurii Karabas writes:
> I am proposing to add smth like JS destructing assignment to python.
> Basically, it will allow unpacking any mapping (should have
> __getitem__ and keys() methods) into variables.
Ideas like this have been suggested before, with a number of
variations on syntax (specif
I am proposing to add smth like JS destructing assignment to python.
Basically, it will allow unpacking any mapping (should have __getitem__ and
keys() methods) into variables.
Proposed syntax:
```
m = {"a": 1, "b": 2, "c": 3, "d": 4}
{a, b} = m # a: 1, b: 2
{a, b, **rest} = m # a: 1, b: 2, rest