Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
Instances
Object Reference Source # | |
Defined in CPython.Types.WeakReference toObject :: Reference -> SomeObject Source # |
Instances
Object Proxy Source # | |
Defined in CPython.Types.WeakReference toObject :: Proxy -> SomeObject Source # fromForeignPtr :: ForeignPtr Proxy -> Proxy |
newReference :: (Object obj, Object callback) => obj -> Maybe callback -> IO Reference Source #
Return a weak reference for the object. This will always return a new
reference, but is not guaranteed to create a new object; an existing
reference object may be returned. The second parameter, callback, can
be a callable object that receives notification when obj is garbage
collected; it should accept a single parameter, which will be the weak
reference object itself. If ob is not a weakly-referencable object, or if
callback is not callable, this will throw a TypeError
.
newProxy :: (Object obj, Object callback) => obj -> Maybe callback -> IO Proxy Source #
Return a weak reference proxy for the object. This will always return a
new reference, but is not guaranteed to create a new object; an existing
proxy may be returned. The second parameter, callback, can be a callable
object that receives notification when obj is garbage collected; it
should accept a single parameter, which will be the weak reference object
itself. If ob is not a weakly-referencable object, or if callback is not
callable, this will throw a TypeError
.