úÎ’½ˆLm      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd e f g h i j k l  John Goerzen,,How to interpret a snippet of Python code. The type of Python exceptions. Exception type Exception value  Traceback Formatted for display The type of Python objects. m         John Goerzen,4nopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œž4nopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œž4nopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œž John Goerzen,Convert a Ptr  to a  . 'Called to make sure the passed CInt isn't -1. Raise an exception if it is. ACalled when a Python exception has been detected. It will raise the exception in Haskell. Uses a   in a function that needs Ptr . Same as -, but uses nullPtr if the input is Nothing. *Returns the default globals environment. HWrapper around C PyImport_AddModule, which looks up an existing module )Gets the dict associated with a module.   John Goerzen,<Members of this class can be derived from a Python object. ;Members of this class can be converted from a Haskell type to a Python object. ?Gets the type of a Python object. Same as type(x) in Python. 8Gets a string representation of a Python object. Same as str(x) in Python. !3Gets the Python representation of a Python object. Same as repr(x) in Python. "(Displays a Python object and its type. #9Displays a list of keys contained in the Python object. $2Call a Python object with all-Haskell parameters.  Similar to  PyObject_Call-. This limits you to a single item type for Othe regular arguments and another single item type for the keyword arguments. 5Nevertheless, it could be a handy shortcut at times.  For a higher-level wrapper, see Python.Interpreter.callByName.  You may find ( and ) useful if you aren't passing any  parameters.  Object t List of non-keyword parameters List of keyword parameters  Return value Ÿ Object t List of non-keyword parameters List of keyword parameters  Return value %Like PyObject_CallHs", but discards the return value.  Object t List of non-keyword parameters List of keyword parameters  Return value  &-Calls the named method of the given object. The main object Name of method to call  Non-kw args  Keyword args Result 'Like &", but discards the return value. The main object Name of method to call  Non-kw args  Keyword args Result ()*&Call a Python object (function, etc).  For a higher-level wrapper, see Python.Interpreter.callByName. #Converts a Python list to a tuple. Object to call .List of non-keyword parameters (may be empty) *List of keyword parameters (may be empty)  Return value +,,An interface to a function similar to Python's getattr. This will 7look up an attribute (such as a method) of an object. -An interface to Python'&s hasattr. Returns True if the named $attribute exists; False otherwise. .An interface to Python'0s setattr, used to set attributes of an object. Object to operate on Name of attribute  Set the attribute to this value ¡Lists from anything else ¢Dicts to Haskell objects £Dicts from Haskell objects ¤,This is a common variant used for arg lists ¥ALs from Dicts ¦Dicts from ALs §Tuples and Lists to [PyObject] lists ¨Lists from a PyObject   !"#$%&'()*+,-.  !"#,-.+*$%&'() !"#$%&'()*+,-. John Goerzen, //Initialize the Python interpreter environment. *MUST BE DONE BEFORE DOING ANYTHING ELSE! 0123Like 4-, but take more Haskellish args and results. Command to run  Start token  -> [(String, a)] -- ^ Globals (may be empty) Locals (may be empty) 4Run some code in Python. Command to run  Start Token # -> [(String, PyObject)] -- ^ Globals (may be empty) Locals (may be empty) Result 5-Call a function or callable object by name. Object/function name List of non-keyword parameters List of keyword parameters 6?Call a function or callable object by namem using Haskell args and return values..  You can use ( and ) if you have no simple or +keyword parameters to pass, respectively. Object/function name List of non-keyword parameters List of keyword parameters 7AImport a module into the current environment in the normal sense  (similar to "import" in Python). 8@Wrapper around C PyImport_ImportModule, which imports a module. You may want the higher-level 7 instead. ()/012345678/24356()7801 /012345678 John Goerzen,9Execute the given IO action. If it raises a /, then execute the supplied handler and return 2its return value. Otherwise, process as normal. :Like 9), with the order of arguments reversed. ;CLike catchPy, but catches only instances of the Python class given (see >). <CUseful as the first argument to catchJust, tryJust, or handleJust. /Return Nothing if the given exception is not a , or the exception otherwise. =>When an exception is thrown, it is not immediately formatted. This call will format it. >Returns true if the passed  matches the given Python Mexception class or one of its subclasses. Standard Python exception classes  are given in Python.Exceptions.ExcTypes. ?A handler for use in 9 or :. Grabs the Python exception, >describes it, and raises the description in the IO monad with ©.  9:;<=>?  9:<;=>?9:;<=>? John Goerzen,@6The basic type for a Python file or file-like object. @>s are a member of System.IO.HVIO and can be used as any other &Haskell HVFS object such as a Handle. @2 objects cannot reliably detect EOF when asked by ª, but Dcan detect it and raise the appropriate IOError when it is reached. Also, @: objects cannot determine if they are readable, writable, or seekable in advance. «ATakes a  0 representing a Python file or file-like object and makes it into a @. B Extracts the   representing this @. D5Convert a Haskell open mode to a Python mode string !Open a file on disk and return a @. EGWrap an operation, raising exceptions in the IO monad as appropriate. ¬@ABCDE@ABDEC@ABDE John Goerzen,­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇEThis is Exception in Python; renamed to avoid naming conflicts here. ÈFGHIJKLMNOPQRSTUVWXYZ[\]^_`FGHIJKLMNOPQRSTUVWXYZ[\]^_` John Goerzen,a7The basic type for a Python dict or dict-like object. ÉbTakes a  0 representing a Python dict or dict-like objext and makes it into a a. cTakes a a and returns its internal  . ÊGWrap an operation, raising exceptions in the IO monad as appropriate. ËGive it a CPyObject instead. abcabcabc  John Goerzen,d(Flags used to open a dbm-type database eIOpen a database, creating it anew each time (deleting any existing data) f=Open a database for reading and writing, creating if it doesn't exist gOpen an existing" database for reading and writing hOpen an existing database for read only Ìi.Opens a persistent storage database using the "best" storage mechanism Javailable to Python on this system. This will usually be one of the *dbm 1services, though in rare circumstances, could be "dumbdbm" , which is only marginally better than Database.AnyDBM.StringDBM. jKOpen a database using a specific module given by the first parameter. The module supported are:  dbhash  dbm  dumbdbm  gdbm JSECURITY NOTE: the string is not validated before being passed to Python. 1Do not pass an arbitrary value to this function. Python module name to use Path to database files Flags to use when opening Result defghijdhgfeijdhgfeefghij  John Goerzen,k:Open a GZip file. The compression level should be from 1 G(least compression) to 9 (most compression). This is ignored when the file is opened read-only. &Once opened, the functions defined in System.IO.HVIO can be used to work with it.  File to open Mode to open with Compression Level Resulting handle kkk  John Goerzen,l;Open a BZip2 file. The compression level should be from 1 L(least compression) to 9 (most compression). This is ignored when the file is opened read-only. &Once opened, the functions defined in System.IO.HVIO can be used to work with it. <BZip2 supports only ReadMode and WriteMode for the IOMode.  File to open Mode to open with Compression Level Resulting handle lllÍ     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm n o p q r s t u vw x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨©ª«¬­®¯°±²³´µ¶·¸J¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕkÖ× ØÙMissingPy-0.10.4 Python.TypesPython.Interpreter Python.UtilsPython.ObjectsPython.ExceptionsPython.Objects.FilePython.Exceptions.ExcTypesPython.Objects.DictMissingPy.AnyDBMMissingPy.FileArchive.GZipMissingPy.FileArchive.BZip2Python.ForeignImports StartFromPy_single_input Py_file_input Py_eval_input PyExceptionexcTypeexcValue excTraceBack excFormatted PyGILState CPyGILStatePyObject CPyObjectcpy_GILRelease cpy_GILEnsure py_incref fromCPyObject checkCIntraisePyException withPyObjectmaybeWithPyObjectgetDefaultGlobalspyImport_AddModulepyModule_GetDict FromPyObject fromPyObject ToPyObject toPyObjecttypeOfstrOfreprOf showPyObject dirPyObjectpyObject_CallHspyObject_RunHs callMethodHs runMethodHsnoParms noKwParms pyObject_CallpyList_AsTuplegetattrhasattrsetattr py_initializepy_initializeThreadedwithGILpyRun_SimpleStringpyRun_StringHs pyRun_String callByName callByNameHspyImportpyImport_ImportModulecatchPyhandlePycatchSpecificPy pyExceptionsformatExceptiondoesExceptionMatch exc2ioerrorPyFilemkPyFile fromPyFile openModeConv openPyFilepyfwraparithmeticErrorassertionErrorattributeError pyEOFErrorenvironmentErrorpyMainExceptionfloatingPointError pyIOError importError indexErrorkeyErrorkeyboardInterrupt lookupError memoryError nameErrornotImplementedError pyOSError overflowErrorreferenceError runtimeError standardError syntaxError systemError systemExit typeError valueErrorzeroDivisionErrorPyDictmkPyDict fromPyDictPyDBMOpenFlagsDBM_ReadWriteNewDBM_ReadWriteCreate DBM_ReadWrite DBM_ReadOnly openAnyDBMopenSpecificDBMopenGzopenBz2 pyExceptionTccpy_InitThreadscNonecpyImport_AddModule pyErr_Print pyErr_ClearpyErr_NormalizeException pyErr_Fetch hspy_getexc py_decrefcpyModule_GetDict pyObject_StrpyObject_SetAttrStringpyObject_HasAttrStringpyObject_GetAttrStringcpyList_AsTuplepyMapping_KeyscpyObject_Call pyObject_DirpyFloat_AsDoublepyFloat_FromDoublepyMapping_ItemspyTuple_GetItempyList_GetItem pyTuple_Size pyList_Size pyTuple_Check pyList_CheckpyString_AsStringAndSize pyObject_Type pyObject_ReprpyObject_GetItempyObject_DelItempyObject_SetItem pyDict_New pyList_Append pyList_NewpyLong_FromString pyInt_AsLongpyInt_FromLongpyString_FromStringAndSizepyImport_GetModuleDictpyDict_SetItemStringcpyImport_ImportModuleLevel cpyRun_StringcpyRun_SimpleStringcpy_initializepyErr_GivenExceptionMatchessf2ccpyImport_ImportModuleEx pyObject_HscallMethodHs_internal$fToPyObject[]$fFromPyObject[]1$fToPyObject[]1$fToPyObject[]2$fFromPyObject[]3$fToPyObject[]3$fFromPyObject[]4$fToPyObject[]4baseGHC.BasefailMissingH-1.1.0.3System.IO.HVIOvIsEOFraiseEOFcZeroDivisionError cValueError cTypeError cSystemExit cSystemError cSyntaxErrorcStandardError cRuntimeErrorcReferenceErrorcOverflowErrorcOSErrorcNotImplementedError cNameError cMemoryError cLookupErrorcKeyboardInterrupt cKeyError cIndexError cImportErrorcIOErrorcFloatingPointError cExceptioncEnvironmentError cEOFErrorcAttributeErrorcAssertionErrorcArithmeticErrorexctypes_internal_epydwrapcpydwrapflag2str