[issue8415] namedtuple vs tuple

2010-04-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: We don't do flags either :-) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue8415] namedtuple vs tuple

2010-04-18 Thread H Krishnan
H Krishnan added the comment: Sorry, I didn't know about "python-ideas". Actually, there is a way to do this without breaking any existing code. namedtuple could support an optional additional argument, say, useIterableCtr, which is by default False, and the class template could be appropriate

[issue8415] namedtuple vs tuple

2010-04-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: 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 d

[issue8415] namedtuple vs tuple

2010-04-15 Thread Ezio Melotti
Ezio Melotti added the comment: You should propose this on the python-ideas mailing list first. Anyway it's already too late to do this on Python 2.x, and since it's not backward compatible for the 1-element case, it won't probably be accepted for 3.x either, so I suggest closing this as rejec

[issue8415] namedtuple vs tuple

2010-04-15 Thread H Krishnan
New submission from H Krishnan : Named tuples and tuples have different creation behavior. Changing a tuple to a namedtuple will involve changing the usage as well. For example: >>> ntuple = collections.namedtuple("ntuple", "a,b") >>> ntuple(1,2) ntuple(a=1, b=2) >>> tuple(1,2) Traceback (most