PyNumber_Int screwing Object.

Tim Peters tim.one at comcast.net
Mon Oct 6 20:07:54 EDT 2003


[Bengt Richter]
> A thought -- is there any guarantee that there will be enough memory
> to process an oom exception?

Read your OS owner's manual and see what guarantees they make when you're
out of memory.  Python can't guarantee more than that.  The internal
PyErr_NoMemory() tries to use a preallocated instance of the MemoryError
class so that it won't run out of memory again trying to raise the
exception, but there's certainly no guarantee you have enough memory to get
into a Python function after that.

> Could there be an app-accessible s/w lever somewhere that one could
> kick over for reserve memory (assuming getting to the exception
> handler is guaranteed), like my old VW bug used to have?
>
> It would sputter and lunge when I "ran out" of gas on the freeway to
> work, and I'd just kick the little black lever on the firewall over
> 90 degrees, and sputter, lunge, continue (don't want to forget the
> state of that lever though ;-)

On systems where the C library supports flip_malloc_reserve_lever(), no
problem.  On other systems Python could hold one byte in reserve, just as
soon as you contribute code to make that happen <wink>.






More information about the Python-list mailing list