Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Tim Chase Newsgroups: comp.lang.python Subject: Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask] Date: Sun, 10 Apr 2016 19:46:35 -0500 Lines: 20 Message-ID: References: <570AF0C6.7020007@mrabarnett.plus.com> <20160410194635.075e2ac2@bigbox.christie.dr> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de XvVwVbDV/S1DXCU39GRQxQvMVE19jqFkCctCd0/iXX1w== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'mrab': 0.05; 'subject:question': 0.08; 'subject:still': 0.09; 'tuple': 0.09; 'tuple.': 0.09; 'subject: \n ': 0.15; '-tkc': 0.16; 'already,': 0.16; 'comma': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'one-element': 0.16; 'parentheses': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Was': 0.16; 'wrote:': 0.16; ';-)': 0.18; '>>>': 0.20; 'written': 0.24; 'header:In-Reply-To:1': 0.24; 'subject: [': 0.29; 'except': 0.34; 'needed': 0.36; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'charset:us-ascii': 0.37; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'avoid': 0.61; 'as:': 0.79; 'received:23': 0.84; 'subject:want': 0.93 X-Sender-Id: wwwh|x-authuser|tim@thechases.com X-Sender-Id: wwwh|x-authuser|tim@thechases.com X-MC-Relay: Neutral X-MailChannels-SenderId: wwwh|x-authuser|tim@thechases.com X-MailChannels-Auth-Id: wwwh X-MC-Loop-Signature: 1460335803513:4095092618 X-MC-Ingress-Time: 1460335803513 In-Reply-To: <570AF0C6.7020007@mrabarnett.plus.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) X-AuthUser: tim@thechases.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <20160410194635.075e2ac2@bigbox.christie.dr> X-Mailman-Original-References: <570AF0C6.7020007@mrabarnett.plus.com> Xref: csiph.com comp.lang.python:106864 On 2016-04-11 01:33, MRAB wrote: > A one-element tuple can be written as: > > >>> ('hello',) > ('hello',) > > As has been said already, it's the comma that makes the tuple. The > parentheses are often needed to avoid ambiguity. Except when the comma *doesn't* make the tuple: >>> t = () >>> type(t) ;-) -tkc