Skip to content

Commit

Permalink
Merge pull request #16 from lancelote/master
Browse files Browse the repository at this point in the history
Namedtuple to dictionary
  • Loading branch information
yasoob committed Aug 17, 2015
2 parents 7b042ff + 4fa13ec commit 28de44a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,6 @@ Like this:

Animal = namedtuple('Animal', 'name age type')
perry = Animal(name="perry", age=31, type="cat")
print(perry._asdict())
# Output: OrderedDict([('name', 'perry'), ('age', 31), ...

0 comments on commit 28de44a

Please sign in to comment.