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, jcrotts, rhettinger, serhiy.storchaka
Date 2018-02-17.08:13:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1518855235.27.0.467229070634.issue32854@psf.upfronthosting.co.za>
In-reply-to
Content
> Would it be worth adding an example of unpacking such as,
> t(**a._asdict()), or something similar to the documentation ?

There are a myriad of uses for dictionaries and the namedtuple docs don't seem like to right place to cover them (**unpacking, str.format_map, str.__mod__, etc).  Even the dict and OrderedDict docs don't cover these.

Also, the use of somefunc(**nt._asdict()) isn't a common pattern.  A requirement for **unpacking tends to nudge design choices towards an actual mapping rather than a tuple or tuple subclass for the underlying data store.  That is likely why this hasn't come-up before.
History
Date User Action Args
2018-02-17 08:13:55rhettingersetrecipients: + rhettinger, serhiy.storchaka, jcrotts, John Crawford
2018-02-17 08:13:55rhettingersetmessageid: <1518855235.27.0.467229070634.issue32854@psf.upfronthosting.co.za>
2018-02-17 08:13:55rhettingerlinkissue32854 messages
2018-02-17 08:13:54rhettingercreate