Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.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.027 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; '+0100,': 0.07; 'am,': 0.14; 'wrote:': 0.14; 'accepting.': 0.16; 'angelico': 0.16; 'docstring': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'obvious.': 0.16; 'meant': 0.18; 'subject:list': 0.19; 'header:In-Reply-To:1': 0.21; 'figure': 0.21; 'body.': 0.23; 'received:209.85.210.174': 0.23; 'received:mail- iy0-f174.google.com': 0.23; 'certainly': 0.25; 'function': 0.25; 'object': 0.26; 'says': 0.27; 'example': 0.27; 'message- id:@mail.gmail.com': 0.28; 'lee': 0.29; 'sat,': 0.29; 'true,': 0.29; 'nested': 0.30; 'sun,': 0.30; 'sort': 0.31; 'steven': 0.32; 'to:addr:python-list': 0.33; 'comment': 0.33; 'chris': 0.34; "d'aprano": 0.35; 'received:google.com': 0.37; 'received:209.85': 0.37; 'but': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'sometimes': 0.39; 'received:209': 0.39; 'to:addr:python.org': 0.39; 'almost': 0.60; 'below': 0.61; 'john': 0.62; 'making': 0.67; '(your': 0.84; 'calls,': 0.84; 'realistic': 0.93 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; bh=0jSe/g4CaDOXxSJWJAh2xUk+3JdyjdJvBE8w47y9t3M=; b=bc/KSwMBBC939IbJKF4nEtKWrfHZLz4alGVxI4K3ArSrnrJs7bJG2rZjF4ES3qBCzL uTB9bMMOU0jYj3n5Mk3q3PRHpW5IkYy8j+SlvaKX8IFUUEsydJVBYW5I44FlHhF7jGEa uaDBztADLBVZTtlMivov9jq0kMp7hN0ZGgP80= 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; b=lAXt8o+F6XJKSxkEojwaJY5zrHay1+9UbxEnXCxwAnFj3I3iTq9oAozmZI9uH8OsCP LaIRlIoNoo8sEedNuLliHK11txirMP8uAUJ7plfzY1LQH4ThDUoPwEkuYwitwu2mzHoT kHVNqybPhz1JYAxuDfkXWJNVnAPDuOQAt7Wag= MIME-Version: 1.0 In-Reply-To: <4dd860a1$0$29996$c3e8da3$5496439d@news.astraweb.com> References: <9hYwp.5805$xo2.3333@newsfe07.iad> <4dc4b351$0$29991$c3e8da3$5496439d@news.astraweb.com> <4dca90c1$0$29980$c3e8da3$5496439d@news.astraweb.com> <930j6nFi2lU1@mid.individual.net> <87r57s6riu.fsf@pobox.com> <4dd860a1$0$29996$c3e8da3$5496439d@news.astraweb.com> Date: Sun, 22 May 2011 12:56:03 +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 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: 16 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1306032972 news.xs4all.nl 49181 [::ffff:82.94.164.166]:59900 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5949 On Sun, May 22, 2011 at 11:02 AM, Steven D'Aprano wrote: > On Sat, 21 May 2011 15:46:01 +0100, John J Lee wrote: > > Er, yes? But in any realistic example (your trivial function xyzzyx below > is not very realistic) you'll almost certainly get additional hints in > the function body. True, but sometimes those hints will be buried in nested calls, making it less obvious. It might well take some digging to figure out just what sort of object it's meant to be accepting. That's why I prefer to have some sort of type declarations; or alternatively, a good docstring / autodoc comment that says what the function wants and gives. Chris Angelico