On 2009-12-11, Grant Edwards <inva...@invalid.invalid> wrote: > On 2009-12-11, Neil Cerutti <ne...@norwich.edu> wrote: >> On 2009-12-11, Grant Edwards <inva...@invalid.invalid> wrote: >>> [s[1:-1] for s in l if (s[0] == s[-1] == '*')] >> >> That last bit doesn't work right, does it, since an == expression >> evaluates to True or False, no the true or false value itself? > > It works for me. Doesn't it work for you? > > From the fine manual (section 5.9. Comparisons): > > Comparisons can be chained arbitrarily, e.g., x < y <= z is > equivalent to x < y and y <= z, except that y is evaluated > only once (but in both cases z is not evaluated at all when x > < y is found to be false).
I did not know that. Thanks, Grant. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list