[issue5205] String Formatting with namedtuple

2009-04-01 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> rejected status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue5205] String Formatting with namedtuple

2009-04-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Other thoughts: Currently the __getitem__ method is inherited from tuple. That means that for normal tuple operations, a named tuple has no performance penalty (no pure python code is called). If __getitem__ were overridden, there would be a substantial ad

[issue5205] String Formatting with namedtuple

2009-04-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Overloading __getitem__ with both Sequence and Mapping behavior feels like a bridge too far. That being said, it does have its uses and I'll take it under advisement. -- priority: -> low versions: +Python 3.1 -Python 2.6 __

[issue5205] String Formatting with namedtuple

2009-04-01 Thread Georg Brandl
Changes by Georg Brandl : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue5205] String Formatting with namedtuple

2009-02-10 Thread Lie Ryan
Changes by Lie Ryan : -- components: +Interpreter Core versions: +Python 2.6 ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue5205] String Formatting with namedtuple

2009-02-10 Thread Lie Ryan
New submission from Lie Ryan : I've been experimenting with namedtuple, it seems that string formatting doesn't recognize namedtuple as mapping. from collections import namedtuple Nt = namedtuple('Nt', ['x', 'y']) nt = Nt(12, 32) print 'one = %(x)s, two = %(y)s' % nt # output should be: one =