Python - how to check if weak reference is still available
        Posted  
        
            by Alex
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Alex
        
        
        
        Published on 2010-06-07T21:43:50Z
        Indexed on 
            2010/06/07
            21:52 UTC
        
        
        Read the original article
        Hit count: 271
        
Hi all,
I am passing some weakrefs from Python into C++ class, but C++ destructors are actively trying to access the ref when the real object is already dead, obviously it crashes...
Is there any Python C/API approach to find out if Python reference is still alive or any other known workaround for this ?
Thanks
© Stack Overflow or respective owner