On 11 November 2017 at 16:22, Jelle Zijlstra <jelle.zijlstra at gmail.com> wrote: > 2017-11-10 19:53 GMT-08:00 Ben Usman <bigobangux at gmail.com>: >> I was not able to find any PEPs that suggest this (search keywords: >> "PEP 445 dicts", "dictionary unpacking assignment", checked PEP-0), >> however, let me know if I am wrong. >> > It was discussed at great length on Python-ideas about a year ago. There is > a thread called "Unpacking a dict" from May 2016. I tend to post this every time the topic comes up, but: it's highly unlikely we'll get syntax for this when we don't even have a builtin to extract multiple items from a mapping in a single operation. So if folks would like dict unpacking syntax, then a suitable place to start would be a proposal for a "getitems" builtin that allowed operations like: b, a = getitems(d, ("b", "a")) operator.itemgetter and operator.attrgetter may provide some inspiration for possible proposals. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4