This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jyasskin
Recipients gvanrossum, jimjjewett, jyasskin, rhettinger, skip.montanaro
Date 2009-01-13.17:58:45
SpamBayes Score 0.06247128
Marked as misclassified No
Message-id <1231869527.24.0.354004803603.issue4888@psf.upfronthosting.co.za>
In-reply-to
Content
The assert seems confusing to me because it's overly specific. It causes
me to ask, "what's special about WHY_YIELD that why might be set to it?"
If I understand the loop correctly, we could rewrite the top as:

assert(why != WHY_YIELD);  /* These two values aren't handled in the
loop. */
assert(why != WHY_RERAISE);
orig_why = why;
while (why != WHY_NOT && f->f_iblock > 0) {
    /* The code does not change 'why' without breaking out of the loop. */
    assert(why == orig_why);
    ...
}

which would tell the reader more about the state of the world without
focusing their attention on anything that isn't somehow special.

Of course, nothing prevents the code from changing orig_why (*pines for
const and late declarations*), but such a change would be more obviously
wrong.

Was there another reason to assert(why!=WHY_YIELD) than that the if's
don't handle it? Is 'why' more likely to become WHY_YIELD than WHY_RERAISE?
History
Date User Action Args
2009-01-13 17:58:47jyasskinsetrecipients: + jyasskin, gvanrossum, skip.montanaro, rhettinger, jimjjewett
2009-01-13 17:58:47jyasskinsetmessageid: <1231869527.24.0.354004803603.issue4888@psf.upfronthosting.co.za>
2009-01-13 17:58:46jyasskinlinkissue4888 messages
2009-01-13 17:58:45jyasskincreate