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


Groups > comp.lang.python > #3656

Re: List comprehension vs filter()

References (1 earlier) <BANLkTinVhX1jDd5brOh1D1m4zU5R8pEoSQ@mail.gmail.com> <BANLkTimvUPXRKOvGNqDzNCJp0UuWT1AkVg@mail.gmail.com> <BANLkTimmfwZ5dB+Vt8S2-rYAwS4axvn8og@mail.gmail.com> <BANLkTimNC7SwWjG6UJf=nvnFz7=U9p3BuA@mail.gmail.com> <BANLkTinua-VN8=8pj4mCtMg0QnHhq-Aq2Q@mail.gmail.com>
Date 2011-04-20 16:22 +1000
Subject Re: List comprehension vs filter()
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.618.1303280564.9059.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Apr 20, 2011 at 4:08 PM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> What is the scope the code is running in?  If this is part of a class
> definition, that could explain why the lambda is not seeing the type /
> posttype closure: because there isn't one.

It's inside an if, but that's all. The body of the code has:

if len(lst):
    posttype=...
    lst=...

No other structural elements to get in the way - unless calling the
code as described is creating one.

Chris Angelico

Back to comp.lang.python | Previous | Next | Find similar


Thread

Re: List comprehension vs filter() Chris Angelico <rosuav@gmail.com> - 2011-04-20 16:22 +1000

csiph-web