2009/3/9 A.T.Hofkamp <a.t.hofk...@tue.nl>:
> You can do something like
> [d for d in d1 if d['is_selected'] == False]
> to get your dicts.
>
> If 'is_selected' is not always present, it gets a bit more complicated, I'll
> leave that as an exercise for the interested reader :)

You would use d.get('is_selected', False) == False.

If nothing is found then .get() will return False instead of None.

Greets
Sander
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to