Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

> 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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32854>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to