This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients John Crawford, rhettinger
Date 2018-02-15.18:52:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1518720770.89.0.467229070634.issue32854@psf.upfronthosting.co.za>
In-reply-to
Content
The intended way to support **unpacking is the _asdict() method:

    t(**a._asdict())

It doesn't really make sense to add direct support for **unpacking because named tuples are sequences and not mappings.  To support **unpacking, we would have to add a keys() method and modify __getitem__() to handle both integer indexing and string key lookup.  Once we have **a and a[k] and a.keys(), people would also want a.values() a.items() etc.  The world gets murky when both sequence and mapping behaviors become commingled.
History
Date User Action Args
2018-02-15 18:52:50rhettingersetrecipients: + rhettinger, John Crawford
2018-02-15 18:52:50rhettingersetmessageid: <1518720770.89.0.467229070634.issue32854@psf.upfronthosting.co.za>
2018-02-15 18:52:50rhettingerlinkissue32854 messages
2018-02-15 18:52:50rhettingercreate