Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!nuzba.szn.dk!pnx.dk!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'python': 0.09; 'array.': 0.09; 'closest': 0.09; 'tuple': 0.09; '(the': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'jr.': 0.16; 'quite.': 0.16; 'subject:dictionaries': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'tuples': 0.22; 'header:In-Reply- To:1': 0.25; 'looks': 0.26; 'c++': 0.27; 'message- id:@mail.gmail.com': 0.27; 'fixed': 0.28; 'received:209.85.212': 0.28; 'all.': 0.28; 'closer': 0.29; 'array': 0.29; 'objects': 0.29; 'daniel': 0.30; 'lists': 0.31; 'could': 0.32; 'strict': 0.33; 'to:addr:python-list': 0.33; 'changed': 0.34; 'received:google.com': 0.34; 'list': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'subject:Please': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; '30,': 0.62; 'helps': 0.63; 'to,': 0.65; '2013': 0.84; 'subject:better': 0.84; 'subject:provide': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=FvGSwetCkOLRV8dmbwvnBgJ3zxS4ReS4aMmR/G0yt7k=; b=moi2Vm+YvoFHvwxoUwFOVdgFqQFpEKW+svLXpzRJtnhtX9eZpet+JH3R3UQx5kNpoO 9bp9E3u+Prcbjylr9ls4YOcByUD0jKv/FZxEMd3PMPqDxxtRQN/E1+HpcJhbVJge/tQl eywnpfKICi5OFbCyH0HGaU1Lul1KM9Poq0RvmiH3bcx1O0v2jkBOdJ+ErdQ4zVQynBx1 lJntyfiIstytvt6Kq2nG7IL8xpn+Wp/aVNA5K8EEZ+QVHjjJatnpO0HccsWK5dv8iEn6 zeLoaVUFOevj9GCfD8dqmFxdBC8bjHVxAM76xK3R4iiC3fBJolH8R+SXQ6VIucqQlXFl uGsg== MIME-Version: 1.0 X-Received: by 10.220.156.10 with SMTP id u10mr3962406vcw.28.1359527151739; Tue, 29 Jan 2013 22:25:51 -0800 (PST) In-Reply-To: References: Date: Wed, 30 Jan 2013 17:25:51 +1100 Subject: Re: Please provide a better explanation of tuples and dictionaries From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1359527154 news.xs4all.nl 6849 [2001:888:2000:d::a6]:51660 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37925 On Wed, Jan 30, 2013 at 5:14 PM, Daniel W. Rouse Jr. wrote: > To me, this looks like an array. Is tuple just the Python name for an array? Not quite. An array is closer to a Python list - a tuple can be thought of as a "frozen list", if you like. Lists can be added to, removed from, and changed in many ways; tuples are what they are, and there's no changing them (the objects inside it could be changed, but WHAT objects are in it won't). Python has no strict match to a C-style array with a fixed size and changeable members; a Python list is closest to a C++ std::vector, if that helps at all. ChrisA