We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 67e11b0 commit 7265e1eCopy full SHA for 7265e1e
src/Python/Internal/Types.hs
@@ -9,6 +9,7 @@
9
module Python.Internal.Types
10
( -- * Data type
11
PyObject(..)
12
+ , withPyObject
13
, unsafeWithPyObject
14
, PyThreadState
15
, PyError(..)
@@ -64,6 +65,9 @@ data PyThreadState
64
65
newtype PyObject = PyObject (ForeignPtr PyObject)
66
deriving stock Show
67
68
+withPyObject :: forall a. PyObject -> (Ptr PyObject -> Py a) -> Py a
69
+withPyObject = coerce (withForeignPtr @PyObject @a)
70
+
71
unsafeWithPyObject :: forall a. PyObject -> (Ptr PyObject -> Py a) -> Py a
72
unsafeWithPyObject = coerce (unsafeWithForeignPtr @PyObject @a)
73
0 commit comments