Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #84643

Re: Is there a more elegant way to spell this?

References <ma8311$q4c$1@ger.gmane.org>
Date 2015-01-27 14:20 +0100
Subject Re: Is there a more elegant way to spell this?
From Chris Warrick <kwpolska@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.18171.1422364818.18130.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Jan 27, 2015 2:16 PM, "Neal Becker" <ndbecker2@gmail.com> wrote:
>
> Is there a more elegant way to spell this?
>
> for x in [_ for _ in seq if some_predicate]:

for x in seq:
    if some_predicate:
        do_something_to(x)

-- 
Chris Warrick <https://chriswarrick.com/>
Sent from my Galaxy S3.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Is there a more elegant way to spell this? Chris Warrick <kwpolska@gmail.com> - 2015-01-27 14:20 +0100
  Re: Is there a more elegant way to spell this? Rob Gaddi <rgaddi@technologyhighland.invalid> - 2015-01-27 09:49 -0800
    Re: Is there a more elegant way to spell this? Emile van Sebille <emile@fenx.com> - 2015-01-27 10:27 -0800

csiph-web