Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.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.072 X-Spam-Evidence: '*H*': 0.86; '*S*': 0.00; '21,': 0.07; '"if': 0.09; '[x]': 0.16; 'comma': 0.16; 'count,': 0.16; 'fluent': 0.16; 'roy': 0.16; 'subject:Remove': 0.16; 'subject:python.': 0.16; 'torn': 0.16; 'tuple': 0.16; 'unpack': 0.16; 'wrote:': 0.18; 'value.': 0.19; 'written': 0.21; 'feb': 0.22; 'regardless': 0.24; 'second': 0.26; 'read,': 0.26; 'header:In-Reply-To:1': 0.27; 'received:172.16': 0.29; 'am,': 0.29; "i'm": 0.30; 'easier': 0.31; 'you\x92re': 0.31; 'subject:from': 0.34; 'received:google.com': 0.35; 'really': 0.36; 'doing': 0.36; 'message-id:@gmail.com': 0.38; 'skip:[ 10': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'how': 0.40; "you're": 0.61; 'header:Message-Id:1': 0.63; 'finally': 0.65; 'charset:windows-1252': 0.65; 'natural': 0.68; 'smith': 0.68; 'article': 0.77; 'as:': 0.81; '"yes,': 0.84; '2014,': 0.84; 'it\x92s': 0.84; 'i\x92ve': 0.84; 'otten': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=8KWnt3+Jm2d6rh5b5NFOsWK+eSFPGxOIOnqCKNNWz40=; b=Dq81eMO6oR6cXrXiIkxEtssAVzmzSdJaUF0amQ0nYpEGdHh5gLu/mVqCnZLEHEju9r EeikBnQNKYTpT0XGhADdNJXr0wU05JJf4qvF92hd77P0bdpBGYDX+G2ehxalJpavhoAD 0EMr5f6GHmEGArzL7JbwEKm5BNfvuwWIx1Axy5zluqGuwjqVtBndKUVInNYaSgeZFZZo yrVphNoblOYl+VgDx7+te8ov5K4Kq+AiY3TiGNLIsqykruwQAbEFHWfI9YxUVAnUc/Fg 06AXggeYUbyS6OH/mQ5mxm10P3XRo+s52VKy+Ho/PjfmWrnGNqniCrtI8x1o93In6/b+ rjSw== X-Received: by 10.66.50.105 with SMTP id b9mr10613417pao.9.1393004928268; Fri, 21 Feb 2014 09:48:48 -0800 (PST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: Remove comma from tuples in python. From: Travis Griggs In-Reply-To: Date: Fri, 21 Feb 2014 09:48:42 -0800 Content-Transfer-Encoding: quoted-printable References: <8ca893cc-c010-486b-ace3-070ff7ffdac8@googlegroups.com> <20140221080032.67e536f9@bigbox.christie.dr> To: python-list@python.org X-Mailer: Apple Mail (2.1827) 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393004937 news.xs4all.nl 2917 [2001:888:2000:d::a6]:58369 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66836 On Feb 21, 2014, at 6:32 AM, Roy Smith wrote: > In article , > Peter Otten <__peter__@web.de> wrote: >=20 >=20 >> [x*x for (x,) in lst] >>=20 >> [paraphrasing...] can be better written as: >>=20 >> [x*x for [x] in items] >=20 > I'm torn between, "Yes, the second form is distinctly easier to read"=20= > and, "If you think the second form is easier to read, you're admitting=20= > you're not really fluent in Python=94. I=92ve used the comma form with struct.unpack() frequently: count, =3D struct.unpack(=91!I=92, self.packet) That=92s after I don=92t use it and end up scratching my head for a = while and finally remember that unpack returns a tuple regardless of how = many things I unpack from it. It=92s just natural if you=92re doing lots = of single unpacks to think it returns a single value. Either way, I much = prefer it to: count =3D struct.unpack(=91!I=92, self.packet)[0]=