[Python-Dev] Weakref design questions

Brian Quinlan brian@sweetapp.com
Fri, 18 Oct 2002 20:54:45 -0700


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. 

> 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.

Cheers,
Brian