In article <mailman.7726.1393948954.18130.python-l...@python.org>,
 Chris Angelico <ros...@gmail.com> wrote:

> On Wed, Mar 5, 2014 at 2:42 AM, Steven D'Aprano
> <steve+comp.lang.pyt...@pearwood.info> wrote:
> > # I never know when to stop
> > if bool(flag) is True is True is True is True is True is True: ...
> 
> The banana problem.
> 
> ChrisA

You can refactor that as:

eval(" is ".join(itertools.chain(["if bool(flag)"], [str(t) for t in 
itertools.repeat(True)])))
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to