On Fri, Oct 14, 2011 at 4:48 PM, Chris Angelico <ros...@gmail.com> wrote: > On Sat, Oct 15, 2011 at 9:30 AM, Tim Chase > <python.l...@tim.thechases.com> wrote: >> The double-if is new to me. I thought it was an error when I first saw it, >> but it seems to be legit syntax (or at least one that 2.7 tolerates, >> intentionally or otherwise...). I think I'd make it clearer with either >> >> > > Yeah, it's legal because you can nest fors and ifs in a list comp. > Stylistic difference, I used "if" instead of "and" because there's no > way that it could be a bitwise and. (It's a cross-language safety net > that I sometimes use.) Although the 10<=i<=20 option is definitely > superior to both.
At least in Python, there is no way that "and" could be a bitwise and either, since it cannot be overloaded. -- http://mail.python.org/mailman/listinfo/python-list