Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'wed,': 0.04; '*is*': 0.09; 'convention.': 0.09; 'received:81.103': 0.09; 'received:81.103.221': 0.09; 'received:81.103.221.35': 0.09; 'received:ispmail.ntl.com': 0.09; 'received:ntl.com': 0.09; 'wrote:': 0.14; 'contexts,': 0.16; 'domain,': 0.16; 'from:addr:hobson42': 0.16; 'from:name:ian': 0.16; 'furman': 0.16; 'modelled.': 0.16; 'nowhere.': 0.16; 'received:192.168.0.12': 0.16; 'received:aamtaout02-winn.ispmail.ntl.com': 0.16; 'reply- to:addr:hobson42': 0.16; "wouldn't": 0.18; 'true,': 0.19; 'programming': 0.20; 'subject:list': 0.22; 'header:In-Reply-To:1': 0.22; 'values': 0.23; 'oriented': 0.23; 'objects': 0.24; 'object': 0.27; 'lists': 0.28; "doesn't": 0.28; 'message-id:@gmail.com': 0.30; 'list': 0.30; 'model': 0.31; '"real': 0.31; 'exist.': 0.31; 'exists,': 0.31; 'to:addr:python-list': 0.32; 'received:192': 0.34; 'received:192.168.0': 0.35; 'header:User-Agent:1': 0.35; '-0700,': 0.35; 'accurate': 0.35; 'items.': 0.35; 'properties': 0.36; 'data': 0.37; 'received:192.168': 0.37; 'some': 0.37; 'but': 0.38; 'pretty': 0.38; 'not,': 0.39; 'to:addr:python.org': 0.39; 'would': 0.40; 'domain': 0.40; '2011': 0.62; 'truth': 0.65; 'journey': 0.68; 'soon.': 0.72; 'reply-to:no real name:2**0': 0.72; 'header:Reply-To:1': 0.72; 'reply-to:addr:gmail.com': 0.78; "'if": 0.84; '(outside': 0.84; 'invite': 0.87; 'aircraft': 0.91; 'shopping': 0.92 Date: Wed, 11 May 2011 22:02:19 +0100 From: Ian User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Mnenhy/0.8.3 Thunderbird/3.1.10 MIME-Version: 1.0 To: python-list@python.org Subject: Re: checking if a list is empty References: <9hYwp.5805$xo2.3333@newsfe07.iad> <4dc4b351$0$29991$c3e8da3$5496439d@news.astraweb.com> <4dca90c1$0$29980$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=R50lirqlHffDPPkwUlkuVa99MrvKdVWo//yz83qex8g= c=1 sm=0 a=Py4kDrXLE7IA:10 a=vIQC1TJgd7IA:10 a=nDghuxUhq_wA:10 a=hcRjaz30x_AA:10 a=d3ZwFMNkyaEA:10 a=8nJEP1OIZ-IA:10 a=ozkZmDRGYF5hQsPAEZ8A:9 a=vN2Qxu_yhWaMm8bWDfsA:7 a=wPNLvfGTeEIA:10 a=ExiFL-q3zkAA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: hobson42@gmail.com 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: 35 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1305147756 news.xs4all.nl 34849 [::ffff:82.94.164.166]:43404 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5159 On 11/05/2011 20:13, Hans Georg Schaathun wrote: > On Wed, 11 May 2011 12:17:33 -0700, Ethan Furman > wrote: > : 'if li' *is* KISS. > > It /might/ be in some contexts, but a priori it is not, as it > superimposes a truth value on a data type which is otherwise > a pretty accurate model of real objects (outside python). > > One principle of object oriented programming is to bestow the > objects with properties reflecting known properties from the > domain being modelled. Lists do not have truth values in the > application domain, and therefore truth values in the > implementation domain is complicated. > Exactly. Its just a convention. If it exists, its true, if if doesn't its false. In the "real world" lists of zero items do not exist. You don't go shopping with a shopping list of zero items. You don't take a journey going nowhere. You wouldn't have a party and invite nobody. What kind of building is one with zero floors? Would you have an Aircraft Carrier with no aircraft? Oh Wait - the UK has one of those coming into service soon. Regards Ian