Weak references and tracebacks - NEVER MIND

Fernando Pérez fperez528 at yahoo.com
Sun Apr 14 14:52:11 EDT 2002


Martin v. Loewis wrote:

> Fernando Pérez <fperez528 at yahoo.com> writes:
> 
>> > Is it ok to use weak references to hold tracebacks without generating
>> > circular references? From the documentation:
>> 
>> Never mind, you simply can't make those weak refs. Sorry (tested with other
>> types. dumb me).
> 
> Even if it was possible, it would be less useful than you think: Most
> likely, your weak reference would be the *only* reference to the
> traceback object, which in turns would cause the traceback to die, and
> your weak reference go stale immediately.

You're 100% right. And as usual in such cases, a few minutes thought (which I 
should have done before hand :) showed me what the proper solution was.

Thanks,

Fernando.



More information about the Python-list mailing list