Assertion in list comprehension

Chris Mellon arkanes at
Wed Aug 1 20:07:55 CEST 2007

On 8/1/07, beginner <zyzhu2000 at> wrote:
> On Aug 1, 12:35 pm, "Chris Mellon" <arka... at> wrote:
> > On 8/1/07, beginner <zyzhu2... at> wrote:
> >

<much snippage>

> I see. In fact I want to whole block surrounded by __debug__ to be
> optimized away in non-debug runs. If the logic of my program is
> correct, the asserts are guaranteed to be true, no matter what the
> input is. It is not input checking.

I inferred as much. That's why placing it in a unit or doctest is even better.

More information about the Python-list mailing list