[Python-Dev] Showstopper

Neil Schemenauer nas@python.ca
Sun, 15 Apr 2001 14:20:23 -0700


Michael Hudson wrote:
> Two ideas suggest themselves: (1) don't have the resize check
> in PyDict_Next (it could be in PyDict_SetItem instead, though
> the fact that this is safe is delicate to say the least) (2)
> don't use PyDict_Next in dict_traverse.

There is a collector lock in gcmodule.  We could expose methods
for locking and unlocking it.  I'm not sure if that's the right
solution though.

> OTOH, the GC runs __del__ methods, right?

Yes.

> If allocating memory can execute arbitrary Python code, I dread
> to think how many bugs of this form are hiding in Python

I think this is the crux of the problem.  There is probably more
code that does not expect that to happen.  We can fix this
problem without too much trouble but how many more hard to find
ones will be left?  Am I being paranoid?

  Neil