On 18 February 2013 14:23, John Reid <j.r...@mail.cryst.bbk.ac.uk> wrote: [snip] > That said it would be nice to know the rationale for > namedtuple.__new__ to have a different signature to tuple.__new__. I'm > guessing namedtuple._make has a similar interface to tuple.__new__. Does > anyone know what the rationale was for this design?
Because namedtuples use names for the arguments in the constructor: >>> from collections import namedtuple >>> Point = namedtuple('Point', 'x y') >>> p1 = Point(x=2, y=3) >>> p1 Point(x=2, y=3) >>> p1.x 2 Oscar -- http://mail.python.org/mailman/listinfo/python-list