Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #54843 > unrolled thread

Re: Convert namedtuple to dictionary

Started byTim Chase <python.list@tim.thechases.com>
First post2013-09-26 12:22 -0500
Last post2013-09-26 12:22 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Convert namedtuple to dictionary Tim Chase <python.list@tim.thechases.com> - 2013-09-26 12:22 -0500

#54843 — Re: Convert namedtuple to dictionary

FromTim Chase <python.list@tim.thechases.com>
Date2013-09-26 12:22 -0500
SubjectRe: Convert namedtuple to dictionary
Message-ID<mailman.363.1380216072.18130.python-list@python.org>
On 2013-09-26 16:42, Virendra Tripathi wrote:
> Thx Tim. Your solution works.

After Steven's reply, I recommend

  dict((k,v._asdict()) for k,v in d.iteritems())

which simplifies matters.

-tkc

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web