char** to {'':('',)}

Tim Peters tim.one at home.com
Fri Aug 31 13:48:35 EDT 2001


[Ignacio Vazquez-Abrams]
> Well, I've released this needlessly brittle code, so now you can
> critique it in it's entirety:

Nope.  I was never criticizing your code, I was ridiculing your fear of
gotos for your own good <wink>.

> ...
> Ugh. Returning from within the do as soon as the error occurs
> would probably be better anyways.

In which case the code becomes brittle, because you have to remember to
decref the partial result (if any), and every temp, before returning.  It's
not especially hard to get that right when you first write the code, but
under modification the number of error returns increases, and the set of
temps changes, and exactly when each temp first becomes non-NULL shifts, and
then you've got an ever-growing number of code regions that need to be
patched by hand.  The goto version remains dead simple.

come-back-after-you've-maintained-extensions-for-years<wink>-ly y'rs  - tim





More information about the Python-list mailing list