Comparison with False - something I don't understand

Tim Harig usernet at ilthio.net
Thu Dec 2 13:16:03 EST 2010


On 2010-12-02, Paul Rubin <no.email at nospam.invalid> wrote:
> MRAB <python at mrabarnett.plus.com> writes:
>> When writing the C code for the new regex module I thought that it
>> would've been easier if I could've used exceptions to propagate errors
>> and unwind the stack, instead of having to return an error code which
>> had to be checked by the caller, and then have the caller explicitly
>> return an error code to /its/ caller.
>
> That's called longjmp.

The problem is that you might have partially allocated data structures that
you need to free before you can go anywhere.  Jumping up several levels,
without letting the intermediate levels do their cleanup could easily lead
to a memory leak or worse.



More information about the Python-list mailing list