Message103291
Sorry, this was by design. There were two possible constructors, one using positional arguments or keywords and one from an iterable. Either one could have been the main constructor. A number of use cases favored the one that we choose. It was a good decision, but not a perfect one.
To construct a namedtuple directly from an existing tuple, either use:
ntuple(*t)
or
ntuple._make(t)
The class is functioning as designed, documented, and tested. There is no way to change it without breaking most existing uses. Closing as rejected. |
|
Date |
User |
Action |
Args |
2010-04-16 05:40:32 | rhettinger | set | recipients:
+ rhettinger, ezio.melotti, hkrishnan |
2010-04-16 05:40:31 | rhettinger | set | messageid: <1271396431.48.0.0334960258922.issue8415@psf.upfronthosting.co.za> |
2010-04-16 05:40:29 | rhettinger | link | issue8415 messages |
2010-04-16 05:40:28 | rhettinger | create | |
|