ANN.: Beta 1.0 of Weak Reference Extension Module is nowavailable

shindich at shindich at
Sun Nov 19 21:33:23 CET 2000

In article <8v83rj01fou at>,
  "Alex Martelli" <aleaxit at> wrote:
> "Karsten Schneider" <k at> wrote in message
> news:3A176E0F.39BF350B at
>     [snip]
> > However, I have a question about the implementation. The way I
> it,
> > it hooks into Python's [de-]allocation mechanism to make sure weak
> references
> > don't point to objects that no longer exist. Does this require a
> > through all the weak references for each deallocation? If so, that
> > like a new performance problem.
> No!  Only objects that are subject to weak-referencing get their
> deallocation-function hooked; there is no overhead for all other
> deallocations.
> Alex
Alex is absolutely correct. Only those objects that are being weak
referenced will be checked. On top of that, the check is a lookup in the
STL's map, which is a log(n).



Sent via
Before you buy.

More information about the Python-list mailing list