Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!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.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'argument,': 0.09; 'lambda:': 0.09; 'none):': 0.09; 'def': 0.14; 'argument': 0.15; 'arg2,': 0.16; 'dummy': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; "function's": 0.16; 'lambda': 0.16; 'msg:': 0.16; 'subject:pass': 0.16; 'received:74.125.82.44': 0.17; 'received:mail-ww0-f44.google.com': 0.17; 'wrote:': 0.18; 'specifies': 0.18; '(or': 0.22; 'expense': 0.23; 'header:In-Reply- To:1': 0.23; 'function': 0.27; 'not.': 0.27; 'fine.': 0.28; 'message-id:@mail.gmail.com': 0.29; 'definition': 0.30; 'subject:?': 0.31; 'nov': 0.31; 'pm,': 0.31; 'to:addr:python- list': 0.32; 'that,': 0.33; 'message.': 0.34; 'subject:What': 0.34; 'something': 0.36; 'fri,': 0.36; 'else,': 0.36; 'received:74.125.82': 0.37; 'think': 0.37; 'could': 0.38; 'received:google.com': 0.38; 'some': 0.38; 'received:74.125': 0.39; 'help': 0.39; "it's": 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'skip:_ 10': 0.40; 'skip:l 20': 0.40; 'your': 0.61; 'john': 0.62; '2011': 0.62; 'hand,': 0.76; 'subject:should': 0.84; '1:18': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=0ksfMMPrwmfLYaENZqL6hUhTUk5Gk2yDgayOHcXBzX0=; b=KyOQ9SL8fJj4no2bh/EvdeA2yfsNUA65RgdpM/jilgU6lBEa1QWnuqlAoCcE8J3eHC s6tcgEWgHPfOaN0ndxzH9QsomJGNY+0orXMrb+RB8CpJIzrETME2mnrTtN76lWFi4Kpp vsfyk+XADhpK+ijrrR5q2ABWaTGQspV/1O0gM= MIME-Version: 1.0 In-Reply-To: <27955957.352.1321582691251.JavaMail.geo-discussion-forums@prap37> References: <27955957.352.1321582691251.JavaMail.geo-discussion-forums@prap37> Date: Fri, 18 Nov 2011 13:59:13 +1100 Subject: Re: What exactly is "pass"? What should it be? 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1321585155 news.xs4all.nl 6902 [2001:888:2000:d::a6]:56235 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15851 On Fri, Nov 18, 2011 at 1:18 PM, John Ladasky wrote: > def _pass(*args): > =A0 =A0pass > > def long_running_process(arg1, arg2, arg_etc, report =3D _pass): > For some compactness at the expense of brevity, you could use a lambda: def long_running_process(arg1, arg2, arg_etc, report =3D lambda msg: None): Other than that, I think it's fine. (Actually, the lambda has a slight advantage in self-documentation; in the main function's definition it specifies that the 'report' argument is a function that takes one argument, the message. (Or whatever that argument is. Name it appropriately.) If you call your dummy function something else, it may help readability/self-documentation too. On the other hand, it may not. YMMV. ChrisA