Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.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.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'omit': 0.09; 'received:209.85.160.174': 0.09; 'received:mail- gy0-f174.google.com': 0.09; 'subject:python': 0.10; 'am,': 0.12; 'def': 0.13; 'arg': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'lambda': 0.16; 'subject:case': 0.16; 'wrote:': 0.18; 'dec': 0.22; 'header:In-Reply-To:1': 0.22; 'works.': 0.23; 'sat,': 0.25; 'subject:" ': 0.28; 'message- id:@mail.gmail.com': 0.28; 'chris': 0.30; 'version': 0.32; 'received:209.85.160': 0.33; 'to:addr:python-list': 0.34; '17,': 0.34; 'subject:/': 0.35; 'subject:lists': 0.36; 'but': 0.37; 'received:google.com': 0.37; 'some': 0.38; 'received:209.85': 0.38; 'either': 0.39; "it's": 0.40; 'received:209': 0.40; 'to:addr:python.org': 0.40; 'more': 0.61; '2011': 0.61; 'strange': 0.68; 'subject:Making': 0.84; 'spell': 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=L0VRqeQ8ZCpHp553KVGKNalyQ6fEKQyvv1QGxCnDadc=; b=rt1pNO4ZJkieVV0R8S5cnGY6AR5nx7pILWgLlk6gSraaGJb8zVal5FIdIg+sV+ZKZ1 J/AcD2WqmLVtUKuy0ZR5WGFXS7Bn42eMi5v4IVJLEExgyeNRcpFxFcV1NTf1qz+iUeeb sZWbgHKO00T7lGR14NN+ZNQnlZ4JeBIqJy0jA= MIME-Version: 1.0 In-Reply-To: References: Date: Sat, 17 Dec 2011 05:43:17 +1100 Subject: Re: Making the case for "typed" lists/iterators in python 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1324061000 news.xs4all.nl 6939 [2001:888:2000:d::a6]:49231 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:17376 On Sat, Dec 17, 2011 at 5:38 AM, Arnaud Delobelle wrote= : > On 16 December 2011 18:25, Chris Angelico wrote: > >> tee =3D lambda func,arg: (func(arg),arg)[1] > > What a strange way to spell it! > > def tee(func, arg): > =A0 =A0func(arg) > =A0 =A0return arg I started with that version and moved to the lambda for compactness. But either way works. It's no more strange than the way some people omit the u from colour. :) ChrisA