Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.wiretrip.org!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.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '*not*': 0.05; "shouldn't": 0.07; 'something,': 0.07; '>>>': 0.12; 'def': 0.13; 'am,': 0.14; 'wrote:': 0.14; '"actually,': 0.16; '(otherwise': 0.16; '(until': 0.16; '(when': 0.16; 'again!': 0.16; 'furman': 0.16; 'it).': 0.16; 'items;': 0.16; 'lucky,': 0.16; 'subject:list': 0.22; 'header:In- Reply-To:1': 0.22; 'thu,': 0.22; 'chris': 0.27; 'message- id:@mail.gmail.com': 0.28; 'fri,': 0.29; 'forgot': 0.29; 'list': 0.30; 'do.': 0.31; '"real': 0.31; 'exist.': 0.31; 'goto': 0.31; 'does': 0.31; 'all,': 0.31; 'to:addr:python-list': 0.32; 'another': 0.32; 'store': 0.32; 'done,': 0.33; 'reference': 0.34; 'post': 0.34; 'put': 0.35; 'items.': 0.35; 'received:209.85': 0.37; 'received:google.com': 0.38; 'but': 0.38; 'realize': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'empty': 0.40; 'header:Received:5': 0.40; '13,': 0.60; '2011': 0.62; 'yourself': 0.66; 'home': 0.67; '"going': 0.84; '12:02': 0.84; 'ian,': 0.84; 'received:209.85.210.174': 0.84; 'received:mail- iy0-f174.google.com': 0.84; 'scenario': 0.91; 'shopping': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=AjkA3D5OnvtOdOvIlDmUt5s1nEqpMJwttG0nmawDVxU=; b=YsiWFHTgJsiUwadGQkzvQwmc08crPH6KT2AWnsNiM5zodAI5eKGZxb2wPnTkiP24YC a+E7MvEMUJ+yzpfwvXl7y9bWbM9qQwnl08ThWVtsMNvJQhj604Z2xv8Yp7vBOBxxwrPi 3eAXmMAz65/j5yZnoYtj/NyCYaQn3V6wwPG+A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=KbPCG3YjfTX9JBjz1c0ddnz8lZys3Iblt7iehGBJurowliIYYTMcWcLB6R1UiKDZSy GE2culE8Mx3J/hB6HrgaHMHkL2RKk6UP8PGV0FnNyzshkcgP33pbXEamRHDk2kKPKlkv CWp22b3FfzdfYQKJNKKsAL2+FgH8eJMmrH1Kk= MIME-Version: 1.0 In-Reply-To: <4DCBE87D.6000300@stoneleaf.us> References: <9hYwp.5805$xo2.3333@newsfe07.iad> <4dc4b351$0$29991$c3e8da3$5496439d@news.astraweb.com> <4dca90c1$0$29980$c3e8da3$5496439d@news.astraweb.com> <4DCAF95B.60307@gmail.com> <4DCBE87D.6000300@stoneleaf.us> Date: Fri, 13 May 2011 00:13:06 +1000 Subject: Re: checking if a list is empty From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 34 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1305209589 news.xs4all.nl 41113 [::ffff:82.94.164.166]:38734 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5238 On Fri, May 13, 2011 at 12:02 AM, Ethan Furman wrote: > Chris Angelico wrote: >> >> On Thu, May 12, 2011 at 7:02 AM, Ian wrote: >>> >>> In the "real world" =A0lists of zero items do not exist. >>> You don't go shopping with a shopping list of zero items. >> >> Actually, yes you do. You maintain your shopping list between trips; >> whenever you need something, you put it on the list immediately. Then >> when you go shopping, you just take the list with you (if you're >> lucky, you don't need to move or copy it at all, you just get another >> reference to it). Once you're done, you empty the list - you now have >> a shopping list with zero items (until you get home and realize you >> forgot something). > > Um -- you contradicted Ian, then contradicted yourself -- according to yo= ur > scenario your shopping list is *not* empty when you go to the store > (otherwise known as "going shopping" ;). Ehh, mea culpa (I shouldn't post in haste). Replace "Actually, yes you do" with "Actually, yes they do". Indeed you do not *go shopping* with a list of zero items; but a shopping list with no items on it DOES exist (when you come back). def do_shopping(): if shopping_list: goto shop; # Muahahahahaha. for item in shopping_list: inventory.append(item) return; # Muahahahaha again! Chris Angelico