Maintainer | John Goerzen, |
---|---|
Safe Haskell | Safe-Infered |
Maintainer : jgoerzen@complete.org Stability : provisional Portability: portable
Python low-level utilities
Written by John Goerzen, jgoerzen@complete.org
Please use sparingly and with caution. The documentation for their behavior should be considered to be the source code.
- fromCPyObject :: Ptr CPyObject -> IO PyObject
- withPyObject :: PyObject -> (Ptr CPyObject -> IO b) -> IO b
- maybeWithPyObject :: Maybe PyObject -> (Ptr CPyObject -> IO b) -> IO b
- raisePyException :: IO a
- checkCInt :: CInt -> IO CInt
- getDefaultGlobals :: IO PyObject
- pyImport_AddModule :: String -> IO PyObject
- pyModule_GetDict :: PyObject -> IO PyObject
- py_incref :: Ptr CPyObject -> IO ()
Objects
maybeWithPyObject :: Maybe PyObject -> (Ptr CPyObject -> IO b) -> IO bSource
Same as withPyObject
, but uses nullPtr if the input is Nothing.
Exceptions
raisePyException :: IO aSource
Called when a Python exception has been detected. It will raise the exception in Haskell.
checkCInt :: CInt -> IO CIntSource
Called to make sure the passed CInt isn't -1. Raise an exception if it is.
Environment
getDefaultGlobals :: IO PyObjectSource
Returns the default globals environment.
pyImport_AddModule :: String -> IO PyObjectSource
Wrapper around C PyImport_AddModule, which looks up an existing module
pyModule_GetDict :: PyObject -> IO PyObjectSource
Gets the dict associated with a module.