Advertisement
rfmonk

collections_namedtuple_rename.py

Jan 10th, 2014
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. import collections
  5.  
  6. with_class = collections.namedtuple(
  7.     'Person', 'name class age gender',
  8.     rename=True)
  9.  
  10. print with_class._fields
  11.  
  12. two_ages = collections.namedtuple(
  13.     'Person', 'name age gender age',
  14.     rename=True)
  15. print two_ages._fields
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement