A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-November/057961.html below:

[Python-Dev] Weak references: dereference notification

[Python-Dev] Weak references: dereference notification [Python-Dev] Weak references: dereference notificationGustavo J. A. M. Carneiro gjc at inescporto.pt
Wed Nov 9 12:40:25 CET 2005
  Hello,

  I have come across a situation where I find the current weak
references interface for extension types insufficient.

  Currently you only have a tp_weaklistoffset slot, pointing to a
PyObject with weak references.  However, in my case[1] I _really_ need
to be notified when a weak reference is dereferenced.  What happens now
is that, when you call a weakref object, a simple Py_INCREF is done on
the referenced object.  It would be easy to implement a new slot to
contain a function that should be called when a weak reference is
dereferenced.  Or, alternatively, a slot or class attribute that
indicates an alternative type that should be used to create weak
references: instead of the builtin weakref object, a subtype of it, so
you can override tp_call.

  Does this sounds acceptable?
 
  Regards.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=320428

-- 
Gustavo J. A. M. Carneiro
<gjc at inescporto.pt> <gustavo at users.sourceforge.net>
The universe is always one step beyond logic.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4