
May 27, 2016
3:02 p.m.
On Thu, May 26, 2016 at 11:39 PM Steven D'Aprano <steve@pearwood.info> wrote:
On Thu, May 26, 2016 at 11:28:25PM +0100, Nathan Schneider wrote:
Instead of special syntax, what if dict.values() returned a tuple when given keys as arguments:
partner_id, product_id, ship_to, product_ids = my_dict.values( 'partner_id', 'product_id', 'ship_to', 'product_ids')
I like this idea. I think it beats the status quo:
Isn't this the status quo? a, b, c = [mapping[k] for k in ('a', 'b', 'c')] That was already someone's argument that a special dict unpacking syntax is unnecessary.