On 03/19/2020 02:09 AM, Terry Reedy wrote:
On 3/18/2020 10:28 PM, Santiago Basulto wrote:For dictionaries it'd even be more useful: d = { 'first_name': 'Frances', 'last_name': 'Allen', 'email': '[email protected]' } fname, lname = d[['first_name', 'last_name']]Insert ordered dicts make this sort of thing less useful. >>> d = { 'first_name': 'Frances', 'last_name': 'Allen', 'email': '[email protected]' } >>> fname, lname, _ = d >>> fname, lname ('first_name', 'last_name')
I disagree -- the ordered dict would have to be small (maybe five entries) and one would have to know the insertion order. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list
