Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!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.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:code': 0.07; 'terry': 0.07; 'matt': 0.09; 'def': 0.13; 'range(20):': 0.16; 'reedy': 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.18; '2.x': 0.18; 'jan': 0.19; 'cc:no real name:2**0': 0.20; 'dec': 0.22; 'header:In-Reply-To:1': 0.22; 'cc:2**0': 0.24; 'variable': 0.28; 'url:mailman': 0.28; 'message-id:@mail.gmail.com': 0.28; 'yield': 0.29; 'cc:addr:python.org': 0.29; 'pm,': 0.29; 'subject:?': 0.31; 'url:listinfo': 0.32; 'fri,': 0.34; 'thank': 0.35; 'url:python': 0.36; 'received:209.85.161': 0.36; 'received:google.com': 0.37; 'received:209.85': 0.38; 'url:org': 0.39; 'received:209': 0.40; '2011': 0.61; 'you.': 0.63; '"foo"': 0.84; 'joiner': 0.84; 'subject:hack': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=/vYRYrqE3VS7rHcOQ49iJ29a8mCrsOGlt/hziO0a5c4=; b=BXtOMAFSBNtF+LgDH4ZUR8mp9/qEpdYTniqdOXCSkhmDq2RWU/HJRCQuiFoViebkFO ovfJhDS+BMsNmkbZCuF6o/unBYbfOBVefZzswrv/8NBzUXvWwd1aG0LC7NE4lF3FJgqg CqzWV9wrwzecJoC1qxGC5ja3+fHV7RRWRdRmI= MIME-Version: 1.0 In-Reply-To: References: From: Matt Joiner Date: Fri, 2 Dec 2011 16:11:06 +1100 Subject: Re: Clever hack or code abomination? To: Terry Reedy Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1322802691 news.xs4all.nl 6916 [2001:888:2000:d::a6]:43186 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:16527 Thank you. =E0=B2=A0_=E0=B2=A0 On Fri, Dec 2, 2011 at 1:49 PM, Terry Reedy wrote: > On 11/30/2011 10:49 PM, Matt Joiner wrote: >> >> def possible_names(): >> =C2=A0 =C2=A0 yield "foo" >> =C2=A0 =C2=A0 for i in range(20): >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 yield "foo-" + str(i) > > > This is my favorite -- crystal clear with only the variable part variable= . > And it works in both 2.x and 3.x. > > -- > Terry Jan Reedy > > -- > http://mail.python.org/mailman/listinfo/python-list