Re: [Python-Dev] Rationale for different signatures of tuple.__new__ and namedtuple.__new__

2013-02-18 Thread Terry Reedy
Later today you posted "Differences creating tuples and collections.namedtuples" on python-list. http://thread.gmane.org/gmane.comp.python.general/726849 That *is* the proper place to make observations about current Python and ask questions about why it is the way it is and how to work around

Re: [Python-Dev] Rationale for different signatures of tuple.__new__ and namedtuple.__new__

2013-02-18 Thread Hrvoje Niksic
On 02/18/2013 03:32 PM, John Reid wrote: I can do tuple([1,2,3]) but not: from collections import namedtuple namedtuple('B', 'x y z')([1,2,3]) I get a TypeError: __new__() takes exactly 4 arguments (2 given) However I can do: namedtuple('B', 'x y z')._make([1,2,3]) So namedtuple's _make cla

[Python-Dev] Rationale for different signatures of tuple.__new__ and namedtuple.__new__

2013-02-18 Thread John Reid
Hi, I can do tuple([1,2,3]) but not: from collections import namedtuple namedtuple('B', 'x y z')([1,2,3]) I get a TypeError: __new__() takes exactly 4 arguments (2 given) However I can do: namedtuple('B', 'x y z')._make([1,2,3]) So namedtuple's _make classmethod looks a lot like tuple's __ne