Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'arguments': 0.07; 'collections': 0.09; 'cc:addr:python-list': 0.10; 'cc:name:python list': 0.16; 'design?': 0.16; 'guessing': 0.16; 'namedtuple': 0.16; 'namedtuples': 0.16; 'rationale': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'import': 0.21; 'cc:2**0': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'interface': 0.27; 'received:209.85.212': 0.28; "i'm": 0.29; 'point': 0.31; 'anyone': 0.33; 'received:google.com': 0.34; 'similar': 0.35; 'received:209.85': 0.35; 'signature': 0.37; 'does': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'john': 0.60; 'different': 0.63; 'skip:n 10': 0.63; '2013': 0.84; 'oscar': 0.84; 'reid': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=VupBH2Amirz9VSMI2GWoy8vKNwB9+PvmG/9DN9T8b/4=; b=JUDucPZ3ZztZ7zcVGVhmKjhf/tdVh/RegVl4r6tMzx8FKLD37yI8Sg0O37ijHqkMyb PppRCTih3v4O4Z6xP0BtHf8GVN6C4Ig8r2JusD8t4+rQWfPr/2+lIvloRIJG6fHhckuK pMOmuPzOe0HJ+TbJ9lZiERBtE7rdkDDY0pXlnj6FoosD7YyH5PJKdjMkxsCMldQj9CiP Qb4DIlJfB+wqDUyZ77UMApOqADNLK2FAIM7/9NxyacEZVS2A3YFHOCgf0jra68x9BjWz 4lQ8UItIeUlPqyZUD4VwwpbNZSBhH10izmMzbsm1ESiiyha4YnNbRHy5CxoR22lk9P20 9eCg== X-Received: by 10.220.149.11 with SMTP id r11mr15537699vcv.44.1361199239192; Mon, 18 Feb 2013 06:53:59 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <51223946.2020606@mail.cryst.bbk.ac.uk> References: <7a40a426-baa9-46f8-8f9d-59ba32b044f3@googlegroups.com> <51221A6C.3030804@davea.name> <5122360C.20603@mail.cryst.bbk.ac.uk> <51223946.2020606@mail.cryst.bbk.ac.uk> From: Oscar Benjamin Date: Mon, 18 Feb 2013 14:53:39 +0000 Subject: Re: Differences creating tuples and collections.namedtuples To: John Reid Content-Type: text/plain; charset=ISO-8859-1 Cc: Python List X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361199242 news.xs4all.nl 6868 [2001:888:2000:d::a6]:37894 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39099 On 18 February 2013 14:23, John Reid 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