python 2.3.2 hangs when returning an int

Tim Peters tim.one at comcast.net
Tue Feb 24 22:34:02 EST 2004


[omission9]
> Thanks to all who responded.  This took me forever to replicate and is
> not that easy to demonstrate outside of my fairly complex application.
> Basically, I feel that this is the fault of the Python garbage
> collector.

Why?

> What was happening was that in one function I locally defined a class
> which extended wxGrid.  In another function, which was called by the
> first one mentioned, I instantiated another instance, local to the
> function, of that class.  It seems that even though the wxGrid class
> used in the calling function was only used after the function call
> some stray references or something to the other instance were still
> drifting around in the interpreter which were causing some bizarro
> problems like the one in my original post.

Somehow that just doesn't seem to explain everything -- or, indeed, anything
<wink>.

> By eliminating the instance in the function that was being called I
> eliminated the problem. BIZARRE!! What made this so awful was that it
> took many many iterations of these functions to generate the error. I
> have no idea why it didn't blow the first, say, hundred times through.

Do you have any real idea why it did blow eventually?

> Maybe if I ever get the motivation I'll attach a C debugger to the
> whole thing and look deeper into the guts.

That sounds inevitable, alas.  You changed something that appeared to make
your immediate problem go away, but you left it there without pushing on to
an understanding of the true cause.  Such bugs always return, IME.

it's-more-a-matter-of-work-than-of-desire-ly y'rs  - tim





More information about the Python-list mailing list