weakrefs and bound methods
Mathias Panzenboeck
e0427417 at student.tuwien.ac.at
Sun Oct 7 10:59:40 EDT 2007
More information about the Python-list mailing list
Sun Oct 7 10:59:40 EDT 2007
- Previous message (by thread): weakrefs and bound methods
- Next message (by thread): weakrefs and bound methods
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
When I change the class Wrapper to following, the class Foo works: class Wrapper(object): def __init__(self,x): self.func_name = x.func_name self.x = weakref.ref(x.im_self) def __call__(self,*args,**kwargs): x = self.x() if x is None: print "lost reference" else: return getattr(x,self.func_name)(*args,**kwargs) But that's ugly. Any better idea?
- Previous message (by thread): weakrefs and bound methods
- Next message (by thread): weakrefs and bound methods
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list