
May 26, 2016
5:48 a.m.
On 5/26/2016 1:09 AM, Michael Selik wrote:
I agree that comprehensions plus tuple unpacking handle many possible use cases for dict unpacking.
There is another dict method that has been ignored in this discussion.
mapping = {'a': 1, 'b': 2, 'c': 3} x = mapping.pop('a') mapping {'c': 3, 'b': 2}
We have both subscripting and popping to handle getting a value and either leaving or removing the pair. -- Terry Jan Reedy