Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!newsfeed.kamp.net!newsfeed0.kamp.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'distinct': 0.05; 'suppose': 0.05; 'components.': 0.07; 'distinction': 0.07; 'imply': 0.07; 'python': 0.08; 'tuple': 0.09; 'am,': 0.12; 'constructor.': 0.16; 'container,': 0.16; 'offset,': 0.16; 'sees': 0.16; 'subject:syntax': 0.16; 'subject:question': 0.16; 'wrote:': 0.16; 'say,': 0.19; 'jan': 0.19; "doesn't": 0.22; 'header:In- Reply-To:1': 0.22; 'string': 0.24; 'class': 0.29; 'characters,': 0.30; 'components,': 0.30; 'tuples': 0.30; 'x-mailer:apple mail (2.1084)': 0.30; 'certainly': 0.32; 'represents': 0.32; 'objects': 0.32; 'tue,': 0.32; 'list': 0.32; 'it.': 0.33; 'to:addr:python- list': 0.33; 'object': 0.33; 'there': 0.33; 'this.': 0.33; 'list.': 0.34; 'here,': 0.34; 'example,': 0.36; 'offset': 0.36; 'charset:us-ascii': 0.36; 'represent': 0.37; 'list,': 0.37; 'steven': 0.38; 'allows': 0.38; 'think': 0.38; 'sometimes': 0.38; 'should': 0.38; 'define': 0.39; 'subject:: ': 0.39; 'might': 0.40; 'to:addr:python.org': 0.40; 'header:Message-Id:1': 0.62; '31,': 0.64; 'view': 0.64; 'charles': 0.67; '"there': 0.84; '-0500,': 0.84; '2012,': 0.84; 'it"': 0.84; 'received:64.191': 0.84 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: except clause syntax question From: Charles Yeomans In-Reply-To: <4f27ffd8$0$29989$c3e8da3$5496439d@news.astraweb.com> Date: Tue, 31 Jan 2012 11:23:04 -0500 Content-Transfer-Encoding: quoted-printable References: <4f272f1f$0$29989$c3e8da3$5496439d@news.astraweb.com> <4f27ffd8$0$29989$c3e8da3$5496439d@news.astraweb.com> To: Python X-Mailer: Apple Mail (2.1084) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1328026988 news.xs4all.nl 6930 [2001:888:2000:d::a6]:40206 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19646 On Jan 31, 2012, at 9:51 AM, Steven D'Aprano wrote: > On Tue, 31 Jan 2012 08:57:31 -0500, Charles Yeomans wrote: >=20 >> I don't think of a tuple as a container, and I don't think it a >> misunderstanding on my part to think this. >=20 > Well, it is a misunderstanding, because tuples ARE containers. You = might=20 > as well say "I don't think of boxes as containers". What exactly are = they=20 > if not containers? Tuple is a heterogenous datatype that allows one to define objects ad = hoc. That is to say, a tuple represents a single thing distinct from its = components. For example, suppose you need to represent a location in = text by line number and offset within a line. A tuple object makes it = easy to do so without writing a class having no methods other than a = constructor. Here, the components, a line number and an offset, define = a new object distinct from the pieces. One can certainly view a tuple as a list, just as one can view a string = as a list of characters, and sometimes that's useful; the Python dictum = "there should only be one way to do it" doesn't imply that there is only = one way to think of it. Nor am I the only person who sees such a distinction between tuple and = list. Charles Yeomans=