Version 1.0b1 API Documentation generated by Endo 2006-08-14
Build call-back mechanism for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. $Date: 2005/07/20 11:27:58 $ Pearu Peterson
cb_arg_rules = [ { Const('docstropt') : Dict([(CallFunc(Name('l_and'), [Name('isoptional'), Name('isintent_nothide')], None, None), Const('\t\t#pydocsign#'))]), Const('docstrreq') : Dict([(CallFunc(Name('l_and'), [Name('isrequired'), Name('isintent_nothide')], None, None), Const('\t\t#pydocsign#'))]), Const('docstrout') : Dict([(Name('isintent_out'), Const('\t\t#pydocsignout#'))]), Const('latexdocstropt') : Dict([(CallFunc(Name('l_and'), [Name('isoptional'), Name('isintent_nothide')], None, None), List([Const('\\item[]{{}\\verb@#pydocsign#@{}}'), Dict([(Name('hasnote'), Const('--- #note#'))])]))]), Const('latexdocstrreq') : Dict([(CallFunc(Name('l_and'), [Name('isrequired'), Name('isintent_nothide')], None, None), List([Const('\\item[]{{}\\verb@#pydocsign#@{}}'), Dict([(Name('hasnote'), Const('--- #note#'))])]))]), Const('latexdocstrout') : Dict([(Name('isintent_out'), List([Const('\\item[]{{}\\verb@#pydocsignout#@{}}'), Dict([(CallFunc(Name('l_and'), [Name('hasnote'), Name('isintent_hide')], None, None), Const('--- #note#')), (CallFunc(Name('l_and'), [Name('hasnote'), Name('isintent_nothide')], None, None), Const('--- See above.'))])]))]), Const('docsign') : Dict([(CallFunc(Name('l_and'), [Name('isrequired'), Name('isintent_nothide')], None, None), Const('#varname#,'))]), Const('docsignopt') : Dict([(CallFunc(Name('l_and'), [Name('isoptional'), Name('isintent_nothide')], None, None), Const('#varname#,'))]), Const('depend') : Const('') }, { Const('args') : Dict([(CallFunc(Name('l_and'), [Name('isscalar'), Name('isintent_c')], None, None), Const('#ctype# #varname#')), (CallFunc(Name('l_and'), [Name('isscalar'), CallFunc(Name('l_not'), [Name('isintent_c')], None, None)], None, None), Const('#ctype# *#varname#_cb_capi')), (Name('isarray'), Const('#ctype# *#varname#')), (Name('isstring'), Const('#ctype# #varname#'))]), Const('args_nm') : Dict([(CallFunc(Name('l_and'), [Name('isscalar'), Name('isintent_c')], None, None), Const('#varname#')), (CallFunc(Name('l_and'), [Name('isscalar'), CallFunc(Name('l_not'), [Name('isintent_c')], None, None)], None, None), Const('#varname#_cb_capi')), (Name('isarray'), Const('#varname#')), (Name('isstring'), Const('#varname#'))]), Const('args_td') : Dict([(CallFunc(Name('l_and'), [Name('isscalar'), Name('isintent_c')], None, None), Const('#ctype#')), (CallFunc(Name('l_and'), [Name('isscalar'), CallFunc(Name('l_not'), [Name('isintent_c')], None, None)], None, None), Const('#ctype# *')), (Name('isarray'), Const('#ctype# *')), (Name('isstring'), Const('#ctype#'))]), Const('strarglens') : Dict([(Name('isstring'), Const(',int #varname#_cb_len'))]), Const('strarglens_td') : Dict([(Name('isstring'), Const(',int'))]) }, { Const('decl') : Dict([(CallFunc(Name('l_not'), [Name('isintent_c')], None, None), Const('\t#ctype# #varname#=(*#varname#_cb_capi);'))]), Const('error') : Dict([(CallFunc(Name('l_and'), [Name('isintent_c'), Name('isintent_out'), CallFunc(Name('throw_error'), [Const('intent(c,out) is forbidden for callback scalar arguments')], None, None)], None, None), Const(''))]), Const('frompyobj') : List([Dict([(Name('debugcapi'), Const('\tCFUNCSMESS("cb:Getting #varname#->");'))]), Dict([(Name('isintent_out'), Const('\tif (capi_j>capi_i)\n\t\tGETSCALARFROMPYTUPLE(capi_return,capi_i++,#varname#_cb_capi,#ctype#,"#ctype#_from_pyobj failed in converting argument #varname# of call-back function #name# to C #ctype#\\n");'))]), Dict([(CallFunc(Name('l_and'), [Name('debugcapi'), CallFunc(Name('l_and'), [CallFunc(Name('l_not'), [Name('iscomplex')], None, None), Name('isintent_c')], None, None)], None, None), Const('\tfprintf(stderr,"#showvalueformat#.\\n",#varname#);'))]), Dict([(CallFunc(Name('l_and'), [Name('debugcapi'), CallFunc(Name('l_and'), [CallFunc(Name('l_not'), [Name('iscomplex')], None, None), CallFunc(Name('l_not'), [Name('isintent_c')], None, None)], None, None)], None, None), Const('\tfprintf(stderr,"#showvalueformat#.\\n",*#varname#_cb_capi);'))]), Dict([(CallFunc(Name('l_and'), [Name('debugcapi'), CallFunc(Name('l_and'), [Name('iscomplex'), Name('isintent_c')], None, None)], None, None), Const('\tfprintf(stderr,"#showvalueformat#.\\n",(#varname#).r,(#varname#).i);'))]), Dict([(CallFunc(Name('l_and'), [Name('debugcapi'), CallFunc(Name('l_and'), [Name('iscomplex'), CallFunc(Name('l_not'), [Name('isintent_c')], None, None)], None, None)], None, None), Const('\tfprintf(stderr,"#showvalueformat#.\\n",(*#varname#_cb_capi).r,(*#varname#_cb_capi).i);'))])]), Const('need') : List([Dict([(Name('isintent_out'), List([Const('#ctype#_from_pyobj'), Const('GETSCALARFROMPYTUPLE')]))]), Dict([(Name('debugcapi'), Const('CFUNCSMESS'))])]), Const('_check') : Name('isscalar') }, { Const('pyobjfrom') : List([Dict([(Name('isintent_in'), Const('\tif (#name#_nofargs>capi_i)\n\t\tif (PyTuple_SetItem((PyObject *)capi_arglist,capi_i++,pyobj_from_#ctype#1(#varname#)))\n\t\t\tgoto capi_fail;'))]), Dict([(Name('isintent_inout'), Const('\tif (#name#_nofargs>capi_i)\n\t\tif (PyTuple_SetItem((PyObject *)capi_arglist,capi_i++,pyarr_from_p_#ctype#1(#varname#_cb_capi)))\n\t\t\tgoto capi_fail;'))])]), Const('need') : List([Dict([(Name('isintent_in'), Const('pyobj_from_#ctype#1'))]), Dict([(Name('isintent_inout'), Const('pyarr_from_p_#ctype#1'))]), Dict([(Name('iscomplex'), Const('#ctype#'))])]), Const('_check') : CallFunc(Name('l_and'), [Name('isscalar'), Name('isintent_nothide')], None, None), Const('_optional') : Const('') }, { Const('frompyobj') : List([Dict([(Name('debugcapi'), Const('\tCFUNCSMESS("cb:Getting #varname#->\\"");'))]), Const('\tif (capi_j>capi_i)\n\t\tGETSTRFROMPYTUPLE(capi_return,capi_i++,#varname#,#varname#_cb_len);'), Dict([(Name('debugcapi'), Const('\tfprintf(stderr,"#showvalueformat#\\":%d:.\\n",#varname#,#varname#_cb_len);'))])]), Const('need') : List([Const('#ctype#'), Const('GETSTRFROMPYTUPLE'), Dict([(Name('debugcapi'), Const('CFUNCSMESS'))]), Const('string.h')]), Const('_check') : CallFunc(Name('l_and'), [Name('isstring'), Name('isintent_out')], None, None) }, { Const('pyobjfrom') : List([Dict([(Name('debugcapi'), Const('\tfprintf(stderr,"debug-capi:cb:#varname#=\\"#showvalueformat#\\":%d:\\n",#varname#,#varname#_cb_len);'))]), Dict([(Name('isintent_in'), Const('\tif (#name#_nofargs>capi_i)\n\t\tif (PyTuple_SetItem((PyObject *)capi_arglist,capi_i++,pyobj_from_#ctype#1(#varname#)))\n\t\t\tgoto capi_fail;'))]), Dict([(Name('isintent_inout'), Const('\tif (#name#_nofargs>capi_i) {\n\t\tint #varname#_cb_dims[] = {#varname#_cb_len};\n\t\tif (PyTuple_SetItem((PyObject *)capi_arglist,capi_i++,pyarr_from_p_#ctype#1(#varname#,#varname#_cb_dims)))\n\t\t\tgoto capi_fail;\n\t}'))])]), Const('need') : List([Dict([(Name('isintent_in'), Const('pyobj_from_#ctype#1'))]), Dict([(Name('isintent_inout'), Const('pyarr_from_p_#ctype#1'))])]), Const('_check') : CallFunc(Name('l_and'), [Name('isstring'), Name('isintent_nothide')], None, None), Const('_optional') : Const('') }, { Const('decl') : Const('\tintp #varname#_Dims[#rank#] = {#rank*[-1]#};'), Const('setdims') : Const('\t#cbsetdims#;'), Const('_check') : Name('isarray'), Const('_depend') : Const('') }, { Const('pyobjfrom') : List([Dict([(Name('debugcapi'), Const('\tfprintf(stderr,"debug-capi:cb:#varname#\\n");'))]), Dict([(Name('isintent_c'), Const('\tif (#name#_nofargs>capi_i) {\n\t\tPyArrayObject *tmp_arr = (PyArrayObject *)PyArray_New(&PyArray_Type,#rank#,#varname#_Dims,#atype#,NULL,(char*)#varname#,0,CARRAY_FLAGS,NULL); /*XXX: Hmm, what will destroy this array??? */\n')), (CallFunc(Name('l_not'), [Name('isintent_c')], None, None), Const('\tif (#name#_nofargs>capi_i) {\n\t\tPyArrayObject *tmp_arr = (PyArrayObject *)PyArray_New(&PyArray_Type,#rank#,#varname#_Dims,#atype#,NULL,(char*)#varname#,0,FARRAY_FLAGS,NULL); /*XXX: Hmm, what will destroy this array??? */\n'))]), Const('\n\t\tif (tmp_arr==NULL)\n\t\t\tgoto capi_fail;\n\t\tif (PyTuple_SetItem((PyObject *)capi_arglist,capi_i++,(PyObject *)tmp_arr))\n\t\t\tgoto capi_fail;\n}')]), Const('_check') : CallFunc(Name('l_and'), [Name('isarray'), Name('isintent_nothide'), CallFunc(Name('l_or'), [Name('isintent_in'), Name('isintent_inout')], None, None)], None, None), Const('_optional') : Const('') }, { Const('frompyobj') : List([Dict([(Name('debugcapi'), Const('\tCFUNCSMESS("cb:Getting #varname#->");'))]), Const('\tif (capi_j>capi_i) {\n\t\tPyArrayObject *rv_cb_arr = NULL;\n\t\tif ((capi_tmp = PyTuple_GetItem(capi_return,capi_i++))==NULL) goto capi_fail;\n\t\trv_cb_arr = array_from_pyobj(#atype#,#varname#_Dims,#rank#,F2PY_INTENT_IN'), Dict([(Name('isintent_c'), Const('|F2PY_INTENT_C'))]), Const(',capi_tmp);\n\t\tif (rv_cb_arr == NULL) {\n\t\t\tfprintf(stderr,"rv_cb_arr is NULL\\n");\n\t\t\tgoto capi_fail;\n\t\t}\n\t\tMEMCOPY(#varname#,rv_cb_arr->data,PyArray_NBYTES(rv_cb_arr));\n\t\tif (capi_tmp != (PyObject *)rv_cb_arr) {\n\t\t\tPy_DECREF(rv_cb_arr);\n\t\t}\n\t}'), Dict([(Name('debugcapi'), Const('\tfprintf(stderr,"<-.\\n");'))])]), Const('need') : List([Const('MEMCOPY'), Dict([(Name('iscomplexarray'), Const('#ctype#'))])]), Const('_check') : CallFunc(Name('l_and'), [Name('isarray'), Name('isintent_out')], None, None) }, { Const('docreturn') : Const('#varname#,'), Const('_check') : Name('isintent_out') } ]
################# Build call-back module #############
cb_map = { }
cb_rout_rules = [ { Const('separatorsfor') : Dict([(Const('decl'), Const('\n')), (Const('args'), Const(',')), (Const('optargs'), Const('')), (Const('pyobjfrom'), Const('\n')), (Const('freemem'), Const('\n')), (Const('args_td'), Const(',')), (Const('optargs_td'), Const('')), (Const('args_nm'), Const(',')), (Const('optargs_nm'), Const('')), (Const('frompyobj'), Const('\n')), (Const('setdims'), Const('\n')), (Const('docstrsigns'), Const('\\n"\n"')), (Const('latexdocstrsigns'), Const('\n')), (Const('latexdocstrreq'), Const('\n')), (Const('latexdocstropt'), Const('\n')), (Const('latexdocstrout'), Const('\n')), (Const('latexdocstrcbs'), Const('\n'))]), Const('decl') : Const('/*decl*/'), Const('pyobjfrom') : Const('/*pyobjfrom*/'), Const('frompyobj') : Const('/*frompyobj*/'), Const('args') : List(()), Const('optargs') : Const(''), Const('return') : Const(''), Const('strarglens') : Const(''), Const('freemem') : Const('/*freemem*/'), Const('args_td') : List(()), Const('optargs_td') : Const(''), Const('strarglens_td') : Const(''), Const('args_nm') : List(()), Const('optargs_nm') : Const(''), Const('strarglens_nm') : Const(''), Const('noargs') : Const(''), Const('setdims') : Const('/*setdims*/'), Const('docstrsigns') : Const(''), Const('latexdocstrsigns') : Const(''), Const('docstrreq') : Const('\tRequired arguments:'), Const('docstropt') : Const('\tOptional arguments:'), Const('docstrout') : Const('\tReturn objects:'), Const('docstrcbs') : Const('\tCall-back functions:'), Const('docreturn') : Const(''), Const('docsign') : Const(''), Const('docsignopt') : Const(''), Const('latexdocstrreq') : Const('\\noindent Required arguments:'), Const('latexdocstropt') : Const('\\noindent Optional arguments:'), Const('latexdocstrout') : Const('\\noindent Return objects:'), Const('latexdocstrcbs') : Const('\\noindent Call-back functions:'), Const('routnote') : Dict([(Name('hasnote'), Const('--- #note#')), (CallFunc(Name('l_not'), [Name('hasnote')], None, None), Const(''))]) }, { Const('decl') : Const('\t#ctype# return_value;'), Const('frompyobj') : List([Dict([(Name('debugcapi'), Const('\tCFUNCSMESS("cb:Getting return_value->");'))]), Const('\tif (capi_j>capi_i)\n\t\tGETSCALARFROMPYTUPLE(capi_return,capi_i++,&return_value,#ctype#,"#ctype#_from_pyobj failed in converting return_value of call-back function #name# to C #ctype#\\n");'), Dict([(Name('debugcapi'), Const('\tfprintf(stderr,"#showvalueformat#.\\n",return_value);'))])]), Const('need') : List([Const('#ctype#_from_pyobj'), Dict([(Name('debugcapi'), Const('CFUNCSMESS'))]), Const('GETSCALARFROMPYTUPLE')]), Const('return') : Const('\treturn return_value;'), Const('_check') : CallFunc(Name('l_and'), [Name('isfunction'), CallFunc(Name('l_not'), [Name('isstringfunction')], None, None), CallFunc(Name('l_not'), [Name('iscomplexfunction')], None, None)], None, None) }, { Const('pyobjfrom') : Dict([(Name('debugcapi'), Const('\tfprintf(stderr,"debug-capi:cb:#name#:%d:\\n",return_value_len);'))]), Const('args') : Const('#ctype# return_value,int return_value_len'), Const('args_nm') : Const('return_value,&return_value_len'), Const('args_td') : Const('#ctype# ,int'), Const('frompyobj') : List([Dict([(Name('debugcapi'), Const('\tCFUNCSMESS("cb:Getting return_value->\\"");'))]), Const('\tif (capi_j>capi_i)\n\t\tGETSTRFROMPYTUPLE(capi_return,capi_i++,return_value,return_value_len);'), Dict([(Name('debugcapi'), Const('\tfprintf(stderr,"#showvalueformat#\\".\\n",return_value);'))])]), Const('need') : List([Const('#ctype#_from_pyobj'), Dict([(Name('debugcapi'), Const('CFUNCSMESS'))]), Const('string.h'), Const('GETSTRFROMPYTUPLE')]), Const('return') : Const('return;'), Const('_check') : Name('isstringfunction') }, { Const('optargs') : Const('\n#ifndef F2PY_CB_RETURNCOMPLEX\n#ctype# *return_value\n#endif\n'), Const('optargs_nm') : Const('\n#ifndef F2PY_CB_RETURNCOMPLEX\nreturn_value\n#endif\n'), Const('optargs_td') : Const('\n#ifndef F2PY_CB_RETURNCOMPLEX\n#ctype# *\n#endif\n'), Const('decl') : Const('\n#ifdef F2PY_CB_RETURNCOMPLEX\n\t#ctype# return_value;\n#endif\n'), Const('frompyobj') : List([Dict([(Name('debugcapi'), Const('\tCFUNCSMESS("cb:Getting return_value->");'))]), Const('\tif (capi_j>capi_i)\n#ifdef F2PY_CB_RETURNCOMPLEX\n\t\tGETSCALARFROMPYTUPLE(capi_return,capi_i++,&return_value,#ctype#,"#ctype#_from_pyobj failed in converting return_value of call-back function #name# to C #ctype#\\n");\n#else\n\t\tGETSCALARFROMPYTUPLE(capi_return,capi_i++,return_value,#ctype#,"#ctype#_from_pyobj failed in converting return_value of call-back function #name# to C #ctype#\\n");\n#endif\n'), Dict([(Name('debugcapi'), Const('\n#ifdef F2PY_CB_RETURNCOMPLEX\n\tfprintf(stderr,"#showvalueformat#.\\n",(return_value).r,(return_value).i);\n#else\n\tfprintf(stderr,"#showvalueformat#.\\n",(*return_value).r,(*return_value).i);\n#endif\n\n'))])]), Const('return') : Const('\n#ifdef F2PY_CB_RETURNCOMPLEX\n\treturn return_value;\n#else\n\treturn;\n#endif\n'), Const('need') : List([Const('#ctype#_from_pyobj'), Dict([(Name('debugcapi'), Const('CFUNCSMESS'))]), Const('string.h'), Const('GETSCALARFROMPYTUPLE'), Const('#ctype#')]), Const('_check') : Name('iscomplexfunction') }, { Const('docstrout') : Const('\t\t#pydocsignout#'), Const('latexdocstrout') : List([Const('\\item[]{{}\\verb@#pydocsignout#@{}}'), Dict([(Name('hasnote'), Const('--- #note#'))])]), Const('docreturn') : Const('#rname#,'), Const('_check') : Name('isfunction') }, { Const('_check') : Name('issubroutine'), Const('return') : Const('return;') } ]
cb_routine_rules = { Const('cbtypedefs') : Const('typedef #rctype#(*#name#_typedef)(#optargs_td##args_td##strarglens_td##noargs#);'), Const('body') : Const('\n#begintitle#\nPyObject *#name#_capi = NULL;/*was Py_None*/\nPyTupleObject *#name#_args_capi = NULL;\nint #name#_nofargs = 0;\njmp_buf #name#_jmpbuf;\n/*typedef #rctype#(*#name#_typedef)(#optargs_td##args_td##strarglens_td##noargs#);*/\n#static# #rctype# #callbackname# (#optargs##args##strarglens##noargs#) {\n\tPyTupleObject *capi_arglist = #name#_args_capi;\n\tPyObject *capi_return = NULL;\n\tPyObject *capi_tmp = NULL;\n\tint capi_j,capi_i = 0;\n\tint capi_longjmp_ok = 1;\n#decl#\n#ifdef F2PY_REPORT_ATEXIT\nf2py_cb_start_clock();\n#endif\n\tCFUNCSMESS("cb:Call-back function #name# (maxnofargs=#maxnofargs#(-#nofoptargs#))\\n");\n\tCFUNCSMESSPY("cb:#name#_capi=",#name#_capi);\n\tif (#name#_capi==NULL) {\n\t\tcapi_longjmp_ok = 0;\n\t\t#name#_capi = PyObject_GetAttrString(#modulename#_module,"#argname#");\n\t}\n\tif (#name#_capi==NULL) {\n\t\tPyErr_SetString(#modulename#_error,"cb: Callback #argname# not defined (as an argument or module #modulename# attribute).\\n");\n\t\tgoto capi_fail;\n\t}\n\tif (PyCObject_Check(#name#_capi)) {\n\t#name#_typedef #name#_cptr;\n\t#name#_cptr = PyCObject_AsVoidPtr(#name#_capi);\n\t#returncptr#(*#name#_cptr)(#optargs_nm##args_nm#);\n\t#return#\n\t}\n\tif (capi_arglist==NULL) {\n\t\tcapi_longjmp_ok = 0;\n\t\tcapi_tmp = PyObject_GetAttrString(#modulename#_module,"#argname#_extra_args");\n\t\tif (capi_tmp) {\n\t\t\tcapi_arglist = (PyTupleObject *)PySequence_Tuple(capi_tmp);\n\t\t\tif (capi_arglist==NULL) {\n\t\t\t\tPyErr_SetString(#modulename#_error,"Failed to convert #modulename#.#argname#_extra_args to tuple.\\n");\n\t\t\t\tgoto capi_fail;\n\t\t\t}\n\t\t} else {\n\t\t\tPyErr_Clear();\n\t\t\tcapi_arglist = (PyTupleObject *)Py_BuildValue("()");\n\t\t}\n\t}\n\tif (capi_arglist == NULL) {\n\t\tPyErr_SetString(#modulename#_error,"Callback #argname# argument list is not set.\\n");\n\t\tgoto capi_fail;\n\t}\n#setdims#\n#pyobjfrom#\n\tCFUNCSMESSPY("cb:capi_arglist=",capi_arglist);\n\tCFUNCSMESS("cb:Call-back calling Python function #argname#.\\n");\n#ifdef F2PY_REPORT_ATEXIT\nf2py_cb_start_call_clock();\n#endif\n\tcapi_return = PyObject_CallObject(#name#_capi,(PyObject *)capi_arglist);\n#ifdef F2PY_REPORT_ATEXIT\nf2py_cb_stop_call_clock();\n#endif\n\tCFUNCSMESSPY("cb:capi_return=",capi_return);\n\tif (capi_return == NULL) {\n\t\tfprintf(stderr,"capi_return is NULL\\n");\n\t\tgoto capi_fail;\n\t}\n\tif (capi_return == Py_None) {\n\t\tPy_DECREF(capi_return);\n\t\tcapi_return = Py_BuildValue("()");\n\t}\n\telse if (!PyTuple_Check(capi_return)) {\n\t\tcapi_return = Py_BuildValue("(N)",capi_return);\n\t}\n\tcapi_j = PyTuple_Size(capi_return);\n\tcapi_i = 0;\n#frompyobj#\n\tCFUNCSMESS("cb:#name#:successful\\n");\n\tPy_DECREF(capi_return);\n#ifdef F2PY_REPORT_ATEXIT\nf2py_cb_stop_clock();\n#endif\n\tgoto capi_return_pt;\ncapi_fail:\n\tfprintf(stderr,"Call-back #name# failed.\\n");\n\tPy_XDECREF(capi_return);\n\tif (capi_longjmp_ok)\n\t\tlongjmp(#name#_jmpbuf,-1);\ncapi_return_pt:\n\t;\n#return#\n}\n#endtitle#\n'), Const('need') : List([Const('setjmp.h'), Const('CFUNCSMESS')]), Const('maxnofargs') : Const('#maxnofargs#'), Const('nofoptargs') : Const('#nofoptargs#'), Const('docstr') : Const('\tdef #argname#(#docsignature#): return #docreturn#\\n\\\n#docstrsigns#'), Const('latexdocstr') : Const('\n{{}\\verb@def #argname#(#latexdocsignature#): return #docreturn#@{}}\n#routnote#\n\n#latexdocstrsigns#'), Const('docstrshort') : Const('def #argname#(#docsignature#): return #docreturn#') }
errmess = sys.stderr.write
f2py_version = __version__.version
outmess = sys.stdout.write
show = pprint.pprint