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/2002-October/029688.html below:

[Python-Dev] Weakref design questions

[Python-Dev] Weakref design questions [Python-Dev] Weakref design questionsDavid Abrahams dave@boost-consulting.com
18 Oct 2002 23:46:45 -0400
Brian Quinlan <brian@sweetapp.com> writes:

> Martin wrote:
> > You don't have to add it to every method. You can perform the check in
> > tp_getattro before performing the method lookup. 
> 
> That would be dangerous! See my original "more evil" example. 

Yeah, doesn't work for that case.

> > Alternatively, you can change the ob_type of the object to simply drop
> 
> > the methods that are not available anymore.
> 
> I like this strategy! But I still think that this is more painful/less
> elegant than using proxies.

I don't see how that works either. If you have two objects of the same
type, they may die at different times. If the type drops its methods
all the objects become disabled. Furthermore, I think it still doesn't
help with "more evil", since nobody's touching the type at that point
- the method has already been looked up and kept alive by binding it
to the underlying object.

-- 
                    David Abrahams
dave@boost-consulting.com * http://www.boost-consulting.com

Building C/C++ Extensions for Python: Dec 9-11, Austin, TX
http://www.enthought.com/training/building_extensions.html




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