I realize assert() is compiled out except in debug builds, but the assert in
the while loop following the fast_block_end label in ceval.c seems
misleading.  It looks like it should be hoisted out of the loop and only
checked before entering the loop.  There are no jumps into the loop.  why is
not assigned WHY_YIELD within the loop.  If you assert before the loop once
I think that will be sufficient and more clearly state the intent.

fast_block_end:
                assert(why != WHY_YIELD);  /* move the assert here */
                while (why != WHY_NOT && f->f_iblock > 0) {
                        PyTryBlock *b = PyFrame_BlockPop(f);

                        /* get rid of the assert here */
                        if (b->b_type == SETUP_LOOP && why == WHY_CONTINUE) {
                                ...
                        }
                        ...
                } /* unwind stack */

Reported to the tracker: http://bugs.python.org/issue4888

Skip
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to