diff --git a/hadoopy/__init__.py b/hadoopy/__init__.py index 4434fd3..5b1ce3a 100644 --- a/hadoopy/__init__.py +++ b/hadoopy/__init__.py @@ -18,7 +18,7 @@ __license__ = 'GPL V3' from _runner import launch, launch_frozen -from _local import launch_local +from _hadoopy_local import launch_local from _hdfs import get, put, readtb, writetb, ls, exists, rmr, isempty, abspath, isdir, mv, mkdir from _job_cli import run from _reporter import status, counter diff --git a/hadoopy/_local.py b/hadoopy/_local.pyx similarity index 100% rename from hadoopy/_local.py rename to hadoopy/_local.pyx diff --git a/hadoopy/_main.c b/hadoopy/_main.c index 2546002..3824289 100644 --- a/hadoopy/_main.c +++ b/hadoopy/_main.c @@ -1,11 +1,12 @@ -/* Generated by Cython 0.15.1 on Mon Mar 19 20:36:54 2012 */ +/* Generated by Cython 0.16 on Fri Aug 3 15:49:38 2012 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. #else - #include /* For offsetof */ #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -34,10 +35,22 @@ #define PY_LONG_LONG LONG_LONG #endif -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif + +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif + +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCFunction_Call PyObject_Call +#else + #define __Pyx_PyCFunction_Call PyCFunction_Call #endif #if PY_VERSION_HEX < 0x02050000 @@ -50,6 +63,9 @@ #define PyNumber_Index(o) PyNumber_Int(o) #define PyIndex_Check(o) PyNumber_Check(o) #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" #endif #if PY_VERSION_HEX < 0x02060000 @@ -83,13 +99,25 @@ #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); #endif #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif + +#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") #endif #if PY_MAJOR_VERSION >= 3 @@ -101,6 +129,17 @@ #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif + +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_GET_LENGTH) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) +#endif + #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject @@ -168,15 +207,6 @@ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) @@ -218,6 +248,14 @@ #define __Pyx_DOCSTR(n) (n) #endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" @@ -265,7 +303,7 @@ # else # define CYTHON_UNUSED # endif -# elif defined(__ICC) || defined(__INTEL_COMPILER) +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED @@ -290,7 +328,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #ifdef __GNUC__ /* Test for GCC > 2.95 */ @@ -422,11 +460,9 @@ struct __pyx_vtabstruct_13_hadoopy_main_KeyValueStream { PyObject *(*put)(struct __pyx_obj_13_hadoopy_main_KeyValueStream *, PyObject *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_13_hadoopy_main_KeyValueStream *__pyx_vtabptr_13_hadoopy_main_KeyValueStream; - #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif - #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); @@ -439,8 +475,21 @@ static struct __pyx_vtabstruct_13_hadoopy_main_KeyValueStream *__pyx_vtabptr_13_ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; - #define __Pyx_RefNannySetupContext(name) __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) @@ -451,7 +500,7 @@ static struct __pyx_vtabstruct_13_hadoopy_main_KeyValueStream *__pyx_vtabptr_13_ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name) + #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) @@ -462,13 +511,16 @@ static struct __pyx_vtabstruct_13_hadoopy_main_KeyValueStream *__pyx_vtabptr_13_ #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif /* CYTHON_REFNANNY */ +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ @@ -486,8 +538,8 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ -static CYTHON_INLINE int __Pyx_NegateNonNeg(int b) { - return unlikely(b < 0) ? b : !b; +static CYTHON_INLINE int __Pyx_NegateNonNeg(int b) { + return unlikely(b < 0) ? b : !b; } static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) { return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b); @@ -496,11 +548,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) { static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/ - #include "descrobject.h" static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /*proto*/ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/ + #include static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ @@ -551,11 +603,26 @@ static int __Pyx_check_binary_version(void); static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ -static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno, - int __pyx_lineno, const char *__pyx_filename); /*proto*/ +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + /* Module declarations from '_hadoopy_main' */ static PyTypeObject *__pyx_ptype_13_hadoopy_main_KeyValueStream = 0; static PyTypeObject *__pyx_ptype_13_hadoopy_main_GroupedValues = 0; @@ -568,12 +635,36 @@ int __pyx_module_is_main__hadoopy_main = 0; static PyObject *__pyx_builtin_StopIteration; static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_KeyError; +static int __pyx_pf_13_hadoopy_main_14KeyValueStream___init__(struct __pyx_obj_13_hadoopy_main_KeyValueStream *__pyx_v_self, PyObject *__pyx_v_key_value_func); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__iter__(struct __pyx_obj_13_hadoopy_main_KeyValueStream *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_4__next__(struct __pyx_obj_13_hadoopy_main_KeyValueStream *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_6put(struct __pyx_obj_13_hadoopy_main_KeyValueStream *__pyx_v_self, PyObject *__pyx_v_kv); /* proto */ +static int __pyx_pf_13_hadoopy_main_13GroupedValues___init__(struct __pyx_obj_13_hadoopy_main_GroupedValues *__pyx_v_self, PyObject *__pyx_v_group_key, PyObject *__pyx_v_key_value_iter); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__iter__(struct __pyx_obj_13_hadoopy_main_GroupedValues *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_4__next__(struct __pyx_obj_13_hadoopy_main_GroupedValues *__pyx_v_self); /* proto */ +static int __pyx_pf_13_hadoopy_main_16GroupedKeyValues___init__(struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *__pyx_v_self, PyObject *__pyx_v_key_value_iter); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__iter__(struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_4__next__(struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *__pyx_v_self); /* proto */ +static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self, PyObject *__pyx_v_mapper, PyObject *__pyx_v_reducer, PyObject *__pyx_v_combiner, PyObject *__pyx_v_task_type, PyObject *__pyx_v_read_fd, PyObject *__pyx_v_write_fd); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2run(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_4process_inout(CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_work_func, PyObject *__pyx_v_in_iter, PyObject *__pyx_v_out_func, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_6print_out_text(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self, PyObject *__pyx_v_iter); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_8print_out_tb(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self, PyObject *__pyx_v_iter); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_10print_out(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self, PyObject *__pyx_v_iter); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_12read_key_value_text(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_14read_offset_value_text(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_16read_in_map(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_18read_in_reduce(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_20is_io_typedbytes(CYTHON_UNUSED struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_22is_on_hadoop(CYTHON_UNUSED struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_24flush_tb_writes(CYTHON_UNUSED struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self); /* proto */ static char __pyx_k_1[] = "%s\t%s\n"; static char __pyx_k_2[] = "read_offset_value_text"; static char __pyx_k_3[] = "mapred_input_format_class"; -static char __pyx_k_4[] = "Brandyn A. White "; -static char __pyx_k_5[] = "GPL V3"; -static char __pyx_k_6[] = "hadoopy._runner"; +static char __pyx_k_4[] = "hadoopy_flush_tb_writes"; +static char __pyx_k_5[] = "Brandyn A. White "; +static char __pyx_k_6[] = "GPL V3"; +static char __pyx_k_7[] = "hadoopy._runner"; static char __pyx_k__r[] = "r"; static char __pyx_k__os[] = "os"; static char __pyx_k__map[] = "map"; @@ -611,6 +702,7 @@ static char __pyx_k____author__[] = "__author__"; static char __pyx_k__typedbytes[] = "typedbytes"; static char __pyx_k____license__[] = "__license__"; static char __pyx_k__read_in_map[] = "read_in_map"; +static char __pyx_k__flush_writes[] = "flush_writes"; static char __pyx_k__is_on_hadoop[] = "is_on_hadoop"; static char __pyx_k__print_out_tb[] = "print_out_tb"; static char __pyx_k__StopIteration[] = "StopIteration"; @@ -621,15 +713,17 @@ static char __pyx_k__key_value_func[] = "key_value_func"; static char __pyx_k__key_value_iter[] = "key_value_iter"; static char __pyx_k__print_out_text[] = "print_out_text"; static char __pyx_k__read_in_reduce[] = "read_in_reduce"; +static char __pyx_k__flush_tb_writes[] = "flush_tb_writes"; static char __pyx_k__is_io_typedbytes[] = "is_io_typedbytes"; static char __pyx_k__stream_map_input[] = "stream_map_input"; static char __pyx_k__read_key_value_text[] = "read_key_value_text"; static PyObject *__pyx_kp_s_1; static PyObject *__pyx_n_s_2; static PyObject *__pyx_n_s_3; -static PyObject *__pyx_kp_s_4; +static PyObject *__pyx_n_s_4; static PyObject *__pyx_kp_s_5; -static PyObject *__pyx_n_s_6; +static PyObject *__pyx_kp_s_6; +static PyObject *__pyx_n_s_7; static PyObject *__pyx_n_s__AttributeError; static PyObject *__pyx_n_s__KeyError; static PyObject *__pyx_n_s__StopIteration; @@ -646,6 +740,8 @@ static PyObject *__pyx_n_s__combiner; static PyObject *__pyx_n_s__configure; static PyObject *__pyx_n_s__environ; static PyObject *__pyx_n_s__fileno; +static PyObject *__pyx_n_s__flush_tb_writes; +static PyObject *__pyx_n_s__flush_writes; static PyObject *__pyx_n_s__group_key; static PyObject *__pyx_n_s__hadoopy; static PyObject *__pyx_n_s__in_iter; @@ -682,45 +778,35 @@ static PyObject *__pyx_n_s__writes; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; -/* "hadoopy/_main.pyx":54 - * cdef object _prev - * cdef object _done - * def __init__(self, key_value_func): # <<<<<<<<<<<<<< - * """ - * Args: - */ - -static int __pyx_pf_13_hadoopy_main_14KeyValueStream___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +/* Python wrapper */ +static int __pyx_pw_13_hadoopy_main_14KeyValueStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_13_hadoopy_main_14KeyValueStream___init__[] = "\n Args:\n key_value_func: Function that returns a KeyValue tuple. Raises\n StopIteration when it is exhausted.\n "; struct wrapperbase __pyx_wrapperbase_13_hadoopy_main_14KeyValueStream___init__; -static int __pyx_pf_13_hadoopy_main_14KeyValueStream___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_13_hadoopy_main_14KeyValueStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key_value_func = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key_value_func,0}; int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key_value_func,0}; - __Pyx_RefNannySetupContext("__init__"); + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; - switch (PyTuple_GET_SIZE(__pyx_args)) { + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); - switch (PyTuple_GET_SIZE(__pyx_args)) { + switch (pos_args) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key_value_func); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -737,6 +823,27 @@ static int __pyx_pf_13_hadoopy_main_14KeyValueStream___init__(PyObject *__pyx_v_ __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_13_hadoopy_main_14KeyValueStream___init__(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self), __pyx_v_key_value_func); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_main.pyx":54 + * cdef object _prev + * cdef object _done + * def __init__(self, key_value_func): # <<<<<<<<<<<<<< + * """ + * Args: + */ + +static int __pyx_pf_13_hadoopy_main_14KeyValueStream___init__(struct __pyx_obj_13_hadoopy_main_KeyValueStream *__pyx_v_self, PyObject *__pyx_v_key_value_func) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); /* "hadoopy/_main.pyx":60 * StopIteration when it is exhausted. @@ -747,9 +854,9 @@ static int __pyx_pf_13_hadoopy_main_14KeyValueStream___init__(PyObject *__pyx_v_ */ __Pyx_INCREF(__pyx_v_key_value_func); __Pyx_GIVEREF(__pyx_v_key_value_func); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_key_value_func); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_key_value_func); - ((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_key_value_func = __pyx_v_key_value_func; + __Pyx_GOTREF(__pyx_v_self->_key_value_func); + __Pyx_DECREF(__pyx_v_self->_key_value_func); + __pyx_v_self->_key_value_func = __pyx_v_key_value_func; /* "hadoopy/_main.pyx":61 * """ @@ -760,9 +867,9 @@ static int __pyx_pf_13_hadoopy_main_14KeyValueStream___init__(PyObject *__pyx_v_ */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_prev); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_prev); - ((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_prev = Py_None; + __Pyx_GOTREF(__pyx_v_self->_prev); + __Pyx_DECREF(__pyx_v_self->_prev); + __pyx_v_self->_prev = Py_None; /* "hadoopy/_main.pyx":62 * self._key_value_func = key_value_func @@ -774,9 +881,9 @@ static int __pyx_pf_13_hadoopy_main_14KeyValueStream___init__(PyObject *__pyx_v_ __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_done); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_done); - ((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_done = __pyx_t_1; + __Pyx_GOTREF(__pyx_v_self->_done); + __Pyx_DECREF(__pyx_v_self->_done); + __pyx_v_self->_done = __pyx_t_1; __pyx_t_1 = 0; __pyx_r = 0; @@ -790,6 +897,17 @@ static int __pyx_pf_13_hadoopy_main_14KeyValueStream___init__(PyObject *__pyx_v_ return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_14KeyValueStream_3__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_14KeyValueStream_3__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_14KeyValueStream_2__iter__(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":64 * self._done = False * @@ -798,11 +916,10 @@ static int __pyx_pf_13_hadoopy_main_14KeyValueStream___init__(PyObject *__pyx_v_ * */ -static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_1__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_1__iter__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__iter__(struct __pyx_obj_13_hadoopy_main_KeyValueStream *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__"); + __Pyx_RefNannySetupContext("__iter__", 0); /* "hadoopy/_main.pyx":65 * @@ -812,8 +929,8 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_1__iter__(PyObject *_ * def __next__(self): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self); - __pyx_r = __pyx_v_self; + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -823,6 +940,19 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_1__iter__(PyObject *_ return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_14KeyValueStream_5__next__(PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_13_hadoopy_main_14KeyValueStream_4__next__[] = "Get next KeyValue tuple\n\n If a value was replaced using 'put', then it is used and cleared.\n\n Returns:\n (key, value)\n\n Raises:\n StopIteration: When key_value_func is exhausted.\n "; +struct wrapperbase __pyx_wrapperbase_13_hadoopy_main_14KeyValueStream_4__next__; +static PyObject *__pyx_pw_13_hadoopy_main_14KeyValueStream_5__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_14KeyValueStream_4__next__(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":67 * return self * @@ -831,10 +961,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_1__iter__(PyObject *_ * */ -static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__(PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_13_hadoopy_main_14KeyValueStream_2__next__[] = "Get next KeyValue tuple\n\n If a value was replaced using 'put', then it is used and cleared.\n\n Returns:\n (key, value)\n\n Raises:\n StopIteration: When key_value_func is exhausted.\n "; -struct wrapperbase __pyx_wrapperbase_13_hadoopy_main_14KeyValueStream_2__next__; -static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_4__next__(struct __pyx_obj_13_hadoopy_main_KeyValueStream *__pyx_v_self) { PyObject *__pyx_v_prev = NULL; PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; @@ -851,7 +978,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__(PyObject *_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__next__"); + __Pyx_RefNannySetupContext("__next__", 0); /* "hadoopy/_main.pyx":78 * StopIteration: When key_value_func is exhausted. @@ -860,7 +987,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__(PyObject *_ * prev = self._prev * self._prev = None */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_prev); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_prev); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "hadoopy/_main.pyx":79 @@ -870,8 +997,8 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__(PyObject *_ * self._prev = None * return prev */ - __Pyx_INCREF(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_prev); - __pyx_v_prev = ((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_prev; + __Pyx_INCREF(__pyx_v_self->_prev); + __pyx_v_prev = __pyx_v_self->_prev; /* "hadoopy/_main.pyx":80 * if self._prev: @@ -882,9 +1009,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__(PyObject *_ */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_prev); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_prev); - ((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_prev = Py_None; + __Pyx_GOTREF(__pyx_v_self->_prev); + __Pyx_DECREF(__pyx_v_self->_prev); + __pyx_v_self->_prev = Py_None; /* "hadoopy/_main.pyx":81 * prev = self._prev @@ -897,9 +1024,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__(PyObject *_ __Pyx_INCREF(__pyx_v_prev); __pyx_r = __pyx_v_prev; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L3; } - __pyx_L5:; + __pyx_L3:; /* "hadoopy/_main.pyx":82 * self._prev = None @@ -908,7 +1035,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__(PyObject *_ * raise StopIteration * try: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_done); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_done); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "hadoopy/_main.pyx":83 @@ -920,9 +1047,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__(PyObject *_ */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L4; } - __pyx_L6:; + __pyx_L4:; /* "hadoopy/_main.pyx":84 * if self._done: @@ -946,23 +1073,23 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__(PyObject *_ * self._done = True */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyObject_Call(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_key_value_func, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_5 = PyObject_Call(__pyx_v_self->_key_value_func, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; - goto __pyx_L11_try_return; + goto __pyx_L9_try_return; } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L14_try_end; - __pyx_L11_try_return:; + goto __pyx_L12_try_end; + __pyx_L9_try_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; - __pyx_L7_error:; + __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "hadoopy/_main.pyx":86 @@ -975,7 +1102,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__(PyObject *_ __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_6) { __Pyx_AddTraceback("_hadoopy_main.KeyValueStream.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); @@ -989,12 +1116,12 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__(PyObject *_ * raise e * */ - __pyx_t_9 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_9 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_done); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_done); - ((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->_done = __pyx_t_9; + __Pyx_GOTREF(__pyx_v_self->_done); + __Pyx_DECREF(__pyx_v_self->_done); + __pyx_v_self->_done = __pyx_t_9; __pyx_t_9 = 0; /* "hadoopy/_main.pyx":88 @@ -1005,24 +1132,24 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__(PyObject *_ * cpdef object put(self, kv): */ __Pyx_Raise(__pyx_v_e, 0, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L8_exception_handled; + goto __pyx_L6_exception_handled; } - __pyx_L9_except_error:; + __pyx_L7_except_error:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; - __pyx_L8_exception_handled:; + __pyx_L6_exception_handled:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); - __pyx_L14_try_end:; + __pyx_L12_try_end:; } __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -1050,7 +1177,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__(PyObject *_ * */ -static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_3put(PyObject *__pyx_v_self, PyObject *__pyx_v_kv); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_14KeyValueStream_7put(PyObject *__pyx_v_self, PyObject *__pyx_v_kv); /*proto*/ static PyObject *__pyx_f_13_hadoopy_main_14KeyValueStream_put(struct __pyx_obj_13_hadoopy_main_KeyValueStream *__pyx_v_self, PyObject *__pyx_v_kv, int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -1060,17 +1187,17 @@ static PyObject *__pyx_f_13_hadoopy_main_14KeyValueStream_put(struct __pyx_obj_1 int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("put"); + __Pyx_RefNannySetupContext("put", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_13_hadoopy_main_14KeyValueStream_3put)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_13_hadoopy_main_14KeyValueStream_7put)) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_kv); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_kv); __Pyx_GIVEREF(__pyx_v_kv); @@ -1112,6 +1239,18 @@ static PyObject *__pyx_f_13_hadoopy_main_14KeyValueStream_put(struct __pyx_obj_1 return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_14KeyValueStream_7put(PyObject *__pyx_v_self, PyObject *__pyx_v_kv); /*proto*/ +static char __pyx_doc_13_hadoopy_main_14KeyValueStream_6put[] = "Place an item back into the stream, return following call to 'next'\n\n Args:\n kv: Previous KeyValue tuple to place back\n "; +static PyObject *__pyx_pw_13_hadoopy_main_14KeyValueStream_7put(PyObject *__pyx_v_self, PyObject *__pyx_v_kv) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_14KeyValueStream_6put(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self), ((PyObject *)__pyx_v_kv)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":90 * raise e * @@ -1120,18 +1259,16 @@ static PyObject *__pyx_f_13_hadoopy_main_14KeyValueStream_put(struct __pyx_obj_1 * */ -static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_3put(PyObject *__pyx_v_self, PyObject *__pyx_v_kv); /*proto*/ -static char __pyx_doc_13_hadoopy_main_14KeyValueStream_3put[] = "Place an item back into the stream, return following call to 'next'\n\n Args:\n kv: Previous KeyValue tuple to place back\n "; -static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_3put(PyObject *__pyx_v_self, PyObject *__pyx_v_kv) { +static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_6put(struct __pyx_obj_13_hadoopy_main_KeyValueStream *__pyx_v_self, PyObject *__pyx_v_kv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("put"); + __Pyx_RefNannySetupContext("put", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_13_hadoopy_main_KeyValueStream *)((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self)->__pyx_vtab)->put(((struct __pyx_obj_13_hadoopy_main_KeyValueStream *)__pyx_v_self), __pyx_v_kv, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_13_hadoopy_main_KeyValueStream *)__pyx_v_self->__pyx_vtab)->put(__pyx_v_self, __pyx_v_kv, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1149,38 +1286,28 @@ static PyObject *__pyx_pf_13_hadoopy_main_14KeyValueStream_3put(PyObject *__pyx_ return __pyx_r; } -/* "hadoopy/_main.pyx":104 - * cdef object _done - * - * def __init__(self, group_key, key_value_iter): # <<<<<<<<<<<<<< - * self._key_value_iter = key_value_iter - * self._group_key = group_key - */ - -static int __pyx_pf_13_hadoopy_main_13GroupedValues___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_13_hadoopy_main_13GroupedValues___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +/* Python wrapper */ +static int __pyx_pw_13_hadoopy_main_13GroupedValues_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_13_hadoopy_main_13GroupedValues_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_group_key = 0; PyObject *__pyx_v_key_value_iter = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__group_key,&__pyx_n_s__key_value_iter,0}; int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__group_key,&__pyx_n_s__key_value_iter,0}; - __Pyx_RefNannySetupContext("__init__"); + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; - switch (PyTuple_GET_SIZE(__pyx_args)) { + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); - switch (PyTuple_GET_SIZE(__pyx_args)) { + switch (pos_args) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__group_key); if (likely(values[0])) kw_args--; @@ -1193,7 +1320,7 @@ static int __pyx_pf_13_hadoopy_main_13GroupedValues___init__(PyObject *__pyx_v_s } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -1212,6 +1339,27 @@ static int __pyx_pf_13_hadoopy_main_13GroupedValues___init__(PyObject *__pyx_v_s __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_13_hadoopy_main_13GroupedValues___init__(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self), __pyx_v_group_key, __pyx_v_key_value_iter); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_main.pyx":104 + * cdef object _done + * + * def __init__(self, group_key, key_value_iter): # <<<<<<<<<<<<<< + * self._key_value_iter = key_value_iter + * self._group_key = group_key + */ + +static int __pyx_pf_13_hadoopy_main_13GroupedValues___init__(struct __pyx_obj_13_hadoopy_main_GroupedValues *__pyx_v_self, PyObject *__pyx_v_group_key, PyObject *__pyx_v_key_value_iter) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); /* "hadoopy/_main.pyx":105 * @@ -1222,9 +1370,9 @@ static int __pyx_pf_13_hadoopy_main_13GroupedValues___init__(PyObject *__pyx_v_s */ __Pyx_INCREF(__pyx_v_key_value_iter); __Pyx_GIVEREF(__pyx_v_key_value_iter); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_key_value_iter); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_key_value_iter); - ((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_key_value_iter = __pyx_v_key_value_iter; + __Pyx_GOTREF(__pyx_v_self->_key_value_iter); + __Pyx_DECREF(__pyx_v_self->_key_value_iter); + __pyx_v_self->_key_value_iter = __pyx_v_key_value_iter; /* "hadoopy/_main.pyx":106 * def __init__(self, group_key, key_value_iter): @@ -1235,9 +1383,9 @@ static int __pyx_pf_13_hadoopy_main_13GroupedValues___init__(PyObject *__pyx_v_s */ __Pyx_INCREF(__pyx_v_group_key); __Pyx_GIVEREF(__pyx_v_group_key); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_group_key); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_group_key); - ((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_group_key = __pyx_v_group_key; + __Pyx_GOTREF(__pyx_v_self->_group_key); + __Pyx_DECREF(__pyx_v_self->_group_key); + __pyx_v_self->_group_key = __pyx_v_group_key; /* "hadoopy/_main.pyx":107 * self._key_value_iter = key_value_iter @@ -1249,9 +1397,9 @@ static int __pyx_pf_13_hadoopy_main_13GroupedValues___init__(PyObject *__pyx_v_s __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_done); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_done); - ((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_done = __pyx_t_1; + __Pyx_GOTREF(__pyx_v_self->_done); + __Pyx_DECREF(__pyx_v_self->_done); + __pyx_v_self->_done = __pyx_t_1; __pyx_t_1 = 0; __pyx_r = 0; @@ -1265,6 +1413,17 @@ static int __pyx_pf_13_hadoopy_main_13GroupedValues___init__(PyObject *__pyx_v_s return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_13GroupedValues_3__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_13GroupedValues_3__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_13GroupedValues_2__iter__(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":109 * self._done = False * @@ -1273,11 +1432,10 @@ static int __pyx_pf_13_hadoopy_main_13GroupedValues___init__(PyObject *__pyx_v_s * */ -static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_1__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_1__iter__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__iter__(struct __pyx_obj_13_hadoopy_main_GroupedValues *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__"); + __Pyx_RefNannySetupContext("__iter__", 0); /* "hadoopy/_main.pyx":110 * @@ -1287,8 +1445,8 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_1__iter__(PyObject *__ * def __next__(self): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self); - __pyx_r = __pyx_v_self; + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -1298,6 +1456,17 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_1__iter__(PyObject *__ return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_13GroupedValues_5__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_13GroupedValues_5__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_13GroupedValues_4__next__(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":112 * return self * @@ -1306,8 +1475,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_1__iter__(PyObject *__ * raise StopIteration */ -static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_4__next__(struct __pyx_obj_13_hadoopy_main_GroupedValues *__pyx_v_self) { PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_v_e = NULL; @@ -1326,7 +1494,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__next__"); + __Pyx_RefNannySetupContext("__next__", 0); /* "hadoopy/_main.pyx":113 * @@ -1335,7 +1503,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ * raise StopIteration * try: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_done); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_done); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "hadoopy/_main.pyx":114 @@ -1347,9 +1515,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + goto __pyx_L3; } - __pyx_L5:; + __pyx_L3:; /* "hadoopy/_main.pyx":115 * if self._done: @@ -1372,9 +1540,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ * except StopIteration, e: * self._done = True */ - __pyx_t_5 = PyObject_GetAttr(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_key_value_iter, __pyx_n_s__next); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_self->_key_value_iter, __pyx_n_s__next); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { @@ -1383,7 +1551,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L4_error;} } __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); @@ -1391,7 +1559,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ if (unlikely(PyList_GET_SIZE(sequence) != 2)) { if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L4_error;} } __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); @@ -1401,23 +1569,23 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_t_8 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; - index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L14_unpacking_failed; + index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L14_unpacking_failed; + index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L15_unpacking_done; - __pyx_L14_unpacking_failed:; + goto __pyx_L13_unpacking_done; + __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} - __pyx_L15_unpacking_done:; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_L13_unpacking_done:; } __pyx_v_k = __pyx_t_5; __pyx_t_5 = 0; @@ -1427,8 +1595,8 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L13_try_end; - __pyx_L6_error:; + goto __pyx_L11_try_end; + __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -1444,7 +1612,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_10) { __Pyx_AddTraceback("_hadoopy_main.GroupedValues.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_5); @@ -1458,12 +1626,12 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ * raise e * # If we get to the end, put the value back */ - __pyx_t_8 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __pyx_t_8 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_done); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_done); - ((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_done = __pyx_t_8; + __Pyx_GOTREF(__pyx_v_self->_done); + __Pyx_DECREF(__pyx_v_self->_done); + __pyx_v_self->_done = __pyx_t_8; __pyx_t_8 = 0; /* "hadoopy/_main.pyx":119 @@ -1474,24 +1642,24 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ * if k != self._group_key: */ __Pyx_Raise(__pyx_v_e, 0, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L7_exception_handled; + goto __pyx_L5_exception_handled; } - __pyx_L8_except_error:; + __pyx_L6_except_error:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; - __pyx_L7_exception_handled:; + __pyx_L5_exception_handled:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); - __pyx_L13_try_end:; + __pyx_L11_try_end:; } /* "hadoopy/_main.pyx":121 @@ -1501,7 +1669,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ * self._done = True * self._key_value_iter.put((k, v)) */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_k, ((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_group_key, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_k, __pyx_v_self->_group_key, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -1517,9 +1685,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_done); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_done); - ((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_done = __pyx_t_5; + __Pyx_GOTREF(__pyx_v_self->_done); + __Pyx_DECREF(__pyx_v_self->_done); + __pyx_v_self->_done = __pyx_t_5; __pyx_t_5 = 0; /* "hadoopy/_main.pyx":123 @@ -1529,10 +1697,10 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ * raise StopIteration * return v */ - __pyx_t_5 = PyObject_GetAttr(((struct __pyx_obj_13_hadoopy_main_GroupedValues *)__pyx_v_self)->_key_value_iter, __pyx_n_s__put); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_self->_key_value_iter, __pyx_n_s__put); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); @@ -1540,7 +1708,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_v); __Pyx_GIVEREF(__pyx_v_v); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7)); __Pyx_GIVEREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; @@ -1559,9 +1727,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L18; + goto __pyx_L16; } - __pyx_L18:; + __pyx_L16:; /* "hadoopy/_main.pyx":125 * self._key_value_iter.put((k, v)) @@ -1593,43 +1761,33 @@ static PyObject *__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__(PyObject *__ return __pyx_r; } -/* "hadoopy/_main.pyx":132 - * cdef object _prev - * cdef object _done - * def __init__(self, key_value_iter): # <<<<<<<<<<<<<< - * self._key_value_iter = key_value_iter - * self._prev = None - */ - -static int __pyx_pf_13_hadoopy_main_16GroupedKeyValues___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_13_hadoopy_main_16GroupedKeyValues___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +/* Python wrapper */ +static int __pyx_pw_13_hadoopy_main_16GroupedKeyValues_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_13_hadoopy_main_16GroupedKeyValues_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key_value_iter = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key_value_iter,0}; int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key_value_iter,0}; - __Pyx_RefNannySetupContext("__init__"); + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; - switch (PyTuple_GET_SIZE(__pyx_args)) { + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); - switch (PyTuple_GET_SIZE(__pyx_args)) { + switch (pos_args) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key_value_iter); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -1646,6 +1804,27 @@ static int __pyx_pf_13_hadoopy_main_16GroupedKeyValues___init__(PyObject *__pyx_ __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_13_hadoopy_main_16GroupedKeyValues___init__(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self), __pyx_v_key_value_iter); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_main.pyx":132 + * cdef object _prev + * cdef object _done + * def __init__(self, key_value_iter): # <<<<<<<<<<<<<< + * self._key_value_iter = key_value_iter + * self._prev = None + */ + +static int __pyx_pf_13_hadoopy_main_16GroupedKeyValues___init__(struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *__pyx_v_self, PyObject *__pyx_v_key_value_iter) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); /* "hadoopy/_main.pyx":133 * cdef object _done @@ -1656,9 +1835,9 @@ static int __pyx_pf_13_hadoopy_main_16GroupedKeyValues___init__(PyObject *__pyx_ */ __Pyx_INCREF(__pyx_v_key_value_iter); __Pyx_GIVEREF(__pyx_v_key_value_iter); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_key_value_iter); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_key_value_iter); - ((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_key_value_iter = __pyx_v_key_value_iter; + __Pyx_GOTREF(__pyx_v_self->_key_value_iter); + __Pyx_DECREF(__pyx_v_self->_key_value_iter); + __pyx_v_self->_key_value_iter = __pyx_v_key_value_iter; /* "hadoopy/_main.pyx":134 * def __init__(self, key_value_iter): @@ -1669,9 +1848,9 @@ static int __pyx_pf_13_hadoopy_main_16GroupedKeyValues___init__(PyObject *__pyx_ */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_prev); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_prev); - ((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_prev = Py_None; + __Pyx_GOTREF(__pyx_v_self->_prev); + __Pyx_DECREF(__pyx_v_self->_prev); + __pyx_v_self->_prev = Py_None; /* "hadoopy/_main.pyx":135 * self._key_value_iter = key_value_iter @@ -1683,9 +1862,9 @@ static int __pyx_pf_13_hadoopy_main_16GroupedKeyValues___init__(PyObject *__pyx_ __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_done); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_done); - ((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_done = __pyx_t_1; + __Pyx_GOTREF(__pyx_v_self->_done); + __Pyx_DECREF(__pyx_v_self->_done); + __pyx_v_self->_done = __pyx_t_1; __pyx_t_1 = 0; __pyx_r = 0; @@ -1699,6 +1878,17 @@ static int __pyx_pf_13_hadoopy_main_16GroupedKeyValues___init__(PyObject *__pyx_ return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_16GroupedKeyValues_3__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_16GroupedKeyValues_3__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__iter__(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":137 * self._done = False * @@ -1707,11 +1897,10 @@ static int __pyx_pf_13_hadoopy_main_16GroupedKeyValues___init__(PyObject *__pyx_ * */ -static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_1__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_1__iter__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__iter__(struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__"); + __Pyx_RefNannySetupContext("__iter__", 0); /* "hadoopy/_main.pyx":138 * @@ -1721,8 +1910,8 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_1__iter__(PyObject * def __next__(self): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self); - __pyx_r = __pyx_v_self; + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -1732,6 +1921,17 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_1__iter__(PyObject return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_16GroupedKeyValues_5__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_16GroupedKeyValues_5__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_16GroupedKeyValues_4__next__(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":140 * return self * @@ -1740,9 +1940,8 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_1__iter__(PyObject * raise StopIteration */ -static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject *__pyx_v_self) { - PyObject *__pyx_v_x = NULL; +static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_4__next__(struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *__pyx_v_self) { + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_v_e = NULL; @@ -1763,7 +1962,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__next__"); + __Pyx_RefNannySetupContext("__next__", 0); /* "hadoopy/_main.pyx":141 * @@ -1772,7 +1971,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject * raise StopIteration * # Exhaust prev */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_done); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_done); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "hadoopy/_main.pyx":142 @@ -1784,9 +1983,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + goto __pyx_L3; } - __pyx_L5:; + __pyx_L3:; /* "hadoopy/_main.pyx":144 * raise StopIteration @@ -1795,7 +1994,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject * for x in self._prev: * pass */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_prev); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_prev); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "hadoopy/_main.pyx":145 @@ -1805,19 +2004,19 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject * pass * try: */ - if (PyList_CheckExact(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_prev) || PyTuple_CheckExact(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_prev)) { - __pyx_t_2 = ((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_prev; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_v_self->_prev) || PyTuple_CheckExact(__pyx_v_self->_prev)) { + __pyx_t_2 = __pyx_v_self->_prev; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_prev); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self->_prev); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; } for (;;) { - if (PyList_CheckExact(__pyx_t_2)) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; - } else if (PyTuple_CheckExact(__pyx_t_2)) { + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; } else { @@ -1836,9 +2035,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L6; + goto __pyx_L4; } - __pyx_L6:; + __pyx_L4:; /* "hadoopy/_main.pyx":147 * for x in self._prev: @@ -1861,9 +2060,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject * except StopIteration, e: * self._done = True */ - __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_key_value_iter, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L9_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->_key_value_iter, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L9_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { @@ -1872,7 +2071,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L9_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); @@ -1880,7 +2079,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject if (unlikely(PyList_GET_SIZE(sequence) != 2)) { if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L9_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); @@ -1890,23 +2089,23 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L9_error;} + __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; - index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L17_unpacking_failed; + index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L17_unpacking_failed; + index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L9_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L18_unpacking_done; - __pyx_L17_unpacking_failed:; + goto __pyx_L16_unpacking_done; + __pyx_L15_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L9_error;} - __pyx_L18_unpacking_done:; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_L16_unpacking_done:; } __pyx_v_k = __pyx_t_2; __pyx_t_2 = 0; @@ -1916,8 +2115,8 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L16_try_end; - __pyx_L9_error:; + goto __pyx_L14_try_end; + __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -1933,7 +2132,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_12) { __Pyx_AddTraceback("_hadoopy_main.GroupedKeyValues.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;} + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_2); @@ -1947,12 +2146,12 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject * raise e * self._key_value_iter.put((k, v)) */ - __pyx_t_10 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;} + __pyx_t_10 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_done); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_done); - ((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_done = __pyx_t_10; + __Pyx_GOTREF(__pyx_v_self->_done); + __Pyx_DECREF(__pyx_v_self->_done); + __pyx_v_self->_done = __pyx_t_10; __pyx_t_10 = 0; /* "hadoopy/_main.pyx":151 @@ -1963,24 +2162,24 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject * self._prev = GroupedValues(k, self._key_value_iter) */ __Pyx_Raise(__pyx_v_e, 0, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L10_exception_handled; + goto __pyx_L8_exception_handled; } - __pyx_L11_except_error:; + __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; - __pyx_L10_exception_handled:; + __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); - __pyx_L16_try_end:; + __pyx_L14_try_end:; } /* "hadoopy/_main.pyx":152 @@ -1990,10 +2189,10 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject * self._prev = GroupedValues(k, self._key_value_iter) * return k, self._prev */ - __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_key_value_iter, __pyx_n_s__put); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->_key_value_iter, __pyx_n_s__put); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); @@ -2001,7 +2200,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_v); __Pyx_GIVEREF(__pyx_v_v); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_9)); __Pyx_GIVEREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; @@ -2019,20 +2218,20 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject * */ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); - __Pyx_INCREF(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_key_value_iter); - PyTuple_SET_ITEM(__pyx_t_9, 1, ((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_key_value_iter); - __Pyx_GIVEREF(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_key_value_iter); + __Pyx_INCREF(__pyx_v_self->_key_value_iter); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_self->_key_value_iter); + __Pyx_GIVEREF(__pyx_v_self->_key_value_iter); __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_13_hadoopy_main_GroupedValues)), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __Pyx_GIVEREF(__pyx_t_5); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_prev); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_prev); - ((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_prev = __pyx_t_5; + __Pyx_GOTREF(__pyx_v_self->_prev); + __Pyx_DECREF(__pyx_v_self->_prev); + __pyx_v_self->_prev = __pyx_t_5; __pyx_t_5 = 0; /* "hadoopy/_main.pyx":154 @@ -2044,13 +2243,13 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); - __Pyx_INCREF(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_prev); - PyTuple_SET_ITEM(__pyx_t_5, 1, ((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_prev); - __Pyx_GIVEREF(((struct __pyx_obj_13_hadoopy_main_GroupedKeyValues *)__pyx_v_self)->_prev); + __Pyx_INCREF(__pyx_v_self->_prev); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->_prev); + __Pyx_GIVEREF(__pyx_v_self->_prev); __pyx_r = ((PyObject *)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; @@ -2074,41 +2273,35 @@ static PyObject *__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__(PyObject return __pyx_r; } -/* "hadoopy/_main.pyx":168 - * cdef object tb - * - * def __init__(self, mapper, reducer, combiner, task_type, read_fd=None, write_fd=None): # <<<<<<<<<<<<<< - * self.mapper = mapper - * self.reducer = reducer - */ - -static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +/* Python wrapper */ +static int __pyx_pw_13_hadoopy_main_11HadoopyTask_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_13_hadoopy_main_11HadoopyTask_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mapper = 0; PyObject *__pyx_v_reducer = 0; PyObject *__pyx_v_combiner = 0; PyObject *__pyx_v_task_type = 0; PyObject *__pyx_v_read_fd = 0; PyObject *__pyx_v_write_fd = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__mapper,&__pyx_n_s__reducer,&__pyx_n_s__combiner,&__pyx_n_s__task_type,&__pyx_n_s__read_fd,&__pyx_n_s__write_fd,0}; int __pyx_r; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__mapper,&__pyx_n_s__reducer,&__pyx_n_s__combiner,&__pyx_n_s__task_type,&__pyx_n_s__read_fd,&__pyx_n_s__write_fd,0}; - __Pyx_RefNannySetupContext("__init__"); + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { PyObject* values[6] = {0,0,0,0,0,0}; + + /* "hadoopy/_main.pyx":168 + * cdef object tb + * + * def __init__(self, mapper, reducer, combiner, task_type, read_fd=None, write_fd=None): # <<<<<<<<<<<<<< + * self.mapper = mapper + * self.reducer = reducer + */ values[4] = ((PyObject *)Py_None); values[5] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; - switch (PyTuple_GET_SIZE(__pyx_args)) { + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -2119,7 +2312,7 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); - switch (PyTuple_GET_SIZE(__pyx_args)) { + switch (pos_args) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mapper); if (likely(values[0])) kw_args--; @@ -2154,7 +2347,7 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2183,6 +2376,24 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self), __pyx_v_mapper, __pyx_v_reducer, __pyx_v_combiner, __pyx_v_task_type, __pyx_v_read_fd, __pyx_v_write_fd); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self, PyObject *__pyx_v_mapper, PyObject *__pyx_v_reducer, PyObject *__pyx_v_combiner, PyObject *__pyx_v_task_type, PyObject *__pyx_v_read_fd, PyObject *__pyx_v_write_fd) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); /* "hadoopy/_main.pyx":169 * @@ -2193,9 +2404,9 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel */ __Pyx_INCREF(__pyx_v_mapper); __Pyx_GIVEREF(__pyx_v_mapper); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->mapper); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->mapper); - ((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->mapper = __pyx_v_mapper; + __Pyx_GOTREF(__pyx_v_self->mapper); + __Pyx_DECREF(__pyx_v_self->mapper); + __pyx_v_self->mapper = __pyx_v_mapper; /* "hadoopy/_main.pyx":170 * def __init__(self, mapper, reducer, combiner, task_type, read_fd=None, write_fd=None): @@ -2206,9 +2417,9 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel */ __Pyx_INCREF(__pyx_v_reducer); __Pyx_GIVEREF(__pyx_v_reducer); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->reducer); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->reducer); - ((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->reducer = __pyx_v_reducer; + __Pyx_GOTREF(__pyx_v_self->reducer); + __Pyx_DECREF(__pyx_v_self->reducer); + __pyx_v_self->reducer = __pyx_v_reducer; /* "hadoopy/_main.pyx":171 * self.mapper = mapper @@ -2219,9 +2430,9 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel */ __Pyx_INCREF(__pyx_v_combiner); __Pyx_GIVEREF(__pyx_v_combiner); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->combiner); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->combiner); - ((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->combiner = __pyx_v_combiner; + __Pyx_GOTREF(__pyx_v_self->combiner); + __Pyx_DECREF(__pyx_v_self->combiner); + __pyx_v_self->combiner = __pyx_v_combiner; /* "hadoopy/_main.pyx":172 * self.reducer = reducer @@ -2232,9 +2443,9 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel */ __Pyx_INCREF(__pyx_v_task_type); __Pyx_GIVEREF(__pyx_v_task_type); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->task_type); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->task_type); - ((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->task_type = __pyx_v_task_type; + __Pyx_GOTREF(__pyx_v_self->task_type); + __Pyx_DECREF(__pyx_v_self->task_type); + __pyx_v_self->task_type = __pyx_v_task_type; /* "hadoopy/_main.pyx":173 * self.combiner = combiner @@ -2243,7 +2454,7 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel * if read_fd is None: * self.read_fd = sys.stdin.fileno() */ - ((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->line_count = 0; + __pyx_v_self->line_count = 0; /* "hadoopy/_main.pyx":174 * self.task_type = task_type @@ -2275,8 +2486,8 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - ((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->read_fd = __pyx_t_4; - goto __pyx_L6; + __pyx_v_self->read_fd = __pyx_t_4; + goto __pyx_L3; } /*else*/ { @@ -2288,7 +2499,7 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel * self.write_fd = sys.stdout.fileno() */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_read_fd); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_read_fd); __Pyx_GIVEREF(__pyx_v_read_fd); @@ -2297,9 +2508,9 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - ((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->read_fd = __pyx_t_4; + __pyx_v_self->read_fd = __pyx_t_4; } - __pyx_L6:; + __pyx_L3:; /* "hadoopy/_main.pyx":178 * else: @@ -2331,8 +2542,8 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - ((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->write_fd = __pyx_t_4; - goto __pyx_L7; + __pyx_v_self->write_fd = __pyx_t_4; + goto __pyx_L4; } /*else*/ { @@ -2341,10 +2552,10 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel * else: * self.write_fd = int(write_fd) # <<<<<<<<<<<<<< * self.read_fp = fdopen(self.read_fd, 'r') - * self.tb = hadoopy.TypedBytesFile(read_fd=self.read_fd, write_fd=self.write_fd) + * self.tb = hadoopy.TypedBytesFile(read_fd=self.read_fd, write_fd=self.write_fd, flush_writes=self.flush_tb_writes()) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_write_fd); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_write_fd); __Pyx_GIVEREF(__pyx_v_write_fd); @@ -2353,23 +2564,23 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - ((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->write_fd = __pyx_t_4; + __pyx_v_self->write_fd = __pyx_t_4; } - __pyx_L7:; + __pyx_L4:; /* "hadoopy/_main.pyx":182 * else: * self.write_fd = int(write_fd) * self.read_fp = fdopen(self.read_fd, 'r') # <<<<<<<<<<<<<< - * self.tb = hadoopy.TypedBytesFile(read_fd=self.read_fd, write_fd=self.write_fd) + * self.tb = hadoopy.TypedBytesFile(read_fd=self.read_fd, write_fd=self.write_fd, flush_writes=self.flush_tb_writes()) * */ - ((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->read_fp = fdopen(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->read_fd, __pyx_k__r); + __pyx_v_self->read_fp = fdopen(__pyx_v_self->read_fd, __pyx_k__r); /* "hadoopy/_main.pyx":183 * self.write_fd = int(write_fd) * self.read_fp = fdopen(self.read_fd, 'r') - * self.tb = hadoopy.TypedBytesFile(read_fd=self.read_fd, write_fd=self.write_fd) # <<<<<<<<<<<<<< + * self.tb = hadoopy.TypedBytesFile(read_fd=self.read_fd, write_fd=self.write_fd, flush_writes=self.flush_tb_writes()) # <<<<<<<<<<<<<< * * # Core methods */ @@ -2380,23 +2591,30 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_5 = PyInt_FromLong(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->read_fd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_self->read_fd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__read_fd), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyInt_FromLong(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->write_fd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_self->write_fd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__write_fd), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__flush_tb_writes); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__flush_writes), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_GIVEREF(__pyx_t_5); - __Pyx_GOTREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->tb); - __Pyx_DECREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->tb); - ((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->tb = __pyx_t_5; - __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->tb); + __Pyx_DECREF(__pyx_v_self->tb); + __pyx_v_self->tb = __pyx_t_6; + __pyx_t_6 = 0; __pyx_r = 0; goto __pyx_L0; @@ -2404,6 +2622,7 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("_hadoopy_main.HadoopyTask.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; @@ -2411,6 +2630,17 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_3run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_3run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_11HadoopyTask_2run(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":186 * * # Core methods @@ -2419,8 +2649,7 @@ static int __pyx_pf_13_hadoopy_main_11HadoopyTask___init__(PyObject *__pyx_v_sel * return self.process_inout(self.mapper, self.read_in_map(), self.print_out, 'map') */ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_1run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_1run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2run(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -2431,7 +2660,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_1run(PyObject *__pyx_v_s int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("run"); + __Pyx_RefNannySetupContext("run", 0); /* "hadoopy/_main.pyx":187 * # Core methods @@ -2440,7 +2669,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_1run(PyObject *__pyx_v_s * return self.process_inout(self.mapper, self.read_in_map(), self.print_out, 'map') * elif self.task_type == 'reduce': */ - __pyx_t_1 = __Pyx_PyString_Equals(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->task_type, ((PyObject *)__pyx_n_s__map), Py_EQ); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyString_Equals(__pyx_v_self->task_type, ((PyObject *)__pyx_n_s__map), Py_EQ); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "hadoopy/_main.pyx":188 @@ -2451,20 +2680,20 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_1run(PyObject *__pyx_v_s * return self.process_inout(self.reducer, self.read_in_reduce(), self.print_out, 'reduce') */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__process_inout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__process_inout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__read_in_map); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_in_map); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__print_out); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_out); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->mapper); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->mapper); - __Pyx_GIVEREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->mapper); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_self->mapper); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->mapper); + __Pyx_GIVEREF(__pyx_v_self->mapper); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); @@ -2481,7 +2710,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_1run(PyObject *__pyx_v_s __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L3; } /* "hadoopy/_main.pyx":189 @@ -2491,7 +2720,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_1run(PyObject *__pyx_v_s * return self.process_inout(self.reducer, self.read_in_reduce(), self.print_out, 'reduce') * elif self.task_type == 'combine': */ - __pyx_t_1 = __Pyx_PyString_Equals(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->task_type, ((PyObject *)__pyx_n_s__reduce), Py_EQ); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyString_Equals(__pyx_v_self->task_type, ((PyObject *)__pyx_n_s__reduce), Py_EQ); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "hadoopy/_main.pyx":190 @@ -2502,20 +2731,20 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_1run(PyObject *__pyx_v_s * return self.process_inout(self.combiner, self.read_in_reduce(), self.print_out, 'reduce') */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__process_inout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__process_inout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__read_in_reduce); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_in_reduce); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__print_out); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_out); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->reducer); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->reducer); - __Pyx_GIVEREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->reducer); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_self->reducer); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->reducer); + __Pyx_GIVEREF(__pyx_v_self->reducer); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5); @@ -2532,7 +2761,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_1run(PyObject *__pyx_v_s __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L3; } /* "hadoopy/_main.pyx":191 @@ -2542,7 +2771,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_1run(PyObject *__pyx_v_s * return self.process_inout(self.combiner, self.read_in_reduce(), self.print_out, 'reduce') * else: */ - __pyx_t_1 = __Pyx_PyString_Equals(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->task_type, ((PyObject *)__pyx_n_s__combine), Py_EQ); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyString_Equals(__pyx_v_self->task_type, ((PyObject *)__pyx_n_s__combine), Py_EQ); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "hadoopy/_main.pyx":192 @@ -2553,20 +2782,20 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_1run(PyObject *__pyx_v_s * return 1 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__process_inout); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__process_inout); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__read_in_reduce); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_in_reduce); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__print_out); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_out); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->combiner); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->combiner); - __Pyx_GIVEREF(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->combiner); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self->combiner); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->combiner); + __Pyx_GIVEREF(__pyx_v_self->combiner); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4); @@ -2583,7 +2812,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_1run(PyObject *__pyx_v_s __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L3; } /*else*/ { @@ -2599,7 +2828,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_1run(PyObject *__pyx_v_s __pyx_r = __pyx_int_1; goto __pyx_L0; } - __pyx_L5:; + __pyx_L3:; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -2616,45 +2845,23 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_1run(PyObject *__pyx_v_s return __pyx_r; } -/* "hadoopy/_main.pyx":197 - * - * @classmethod - * def process_inout(cls, work_func, in_iter, out_func, attr): # <<<<<<<<<<<<<< - * if work_func == None: - * return 1 - */ - -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_5process_inout(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_5process_inout(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_work_func = 0; PyObject *__pyx_v_in_iter = 0; PyObject *__pyx_v_out_func = 0; PyObject *__pyx_v_attr = 0; - PyObject *__pyx_v_call_work_func = NULL; - PyObject *__pyx_v_x = NULL; - PyObject *__pyx_v_work_iter = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - Py_ssize_t __pyx_t_9; - PyObject *(*__pyx_t_10)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__work_func,&__pyx_n_s__in_iter,&__pyx_n_s__out_func,&__pyx_n_s__attr,0}; - __Pyx_RefNannySetupContext("process_inout"); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("process_inout (wrapper)", 0); { PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; - switch (PyTuple_GET_SIZE(__pyx_args)) { + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -2663,7 +2870,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); - switch (PyTuple_GET_SIZE(__pyx_args)) { + switch (pos_args) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__work_func); if (likely(values[0])) kw_args--; @@ -2688,7 +2895,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "process_inout") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_inout") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -2711,6 +2918,39 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_13_hadoopy_main_11HadoopyTask_4process_inout(((PyObject*)__pyx_v_cls), __pyx_v_work_func, __pyx_v_in_iter, __pyx_v_out_func, __pyx_v_attr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_main.pyx":197 + * + * @classmethod + * def process_inout(cls, work_func, in_iter, out_func, attr): # <<<<<<<<<<<<<< + * if work_func == None: + * return 1 + */ + +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_4process_inout(CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_work_func, PyObject *__pyx_v_in_iter, PyObject *__pyx_v_out_func, PyObject *__pyx_v_attr) { + PyObject *__pyx_v_call_work_func = NULL; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_work_iter = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("process_inout", 0); __Pyx_INCREF(__pyx_v_work_func); /* "hadoopy/_main.pyx":198 @@ -2737,9 +2977,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject __Pyx_INCREF(__pyx_int_1); __pyx_r = __pyx_int_1; goto __pyx_L0; - goto __pyx_L6; + goto __pyx_L3; } - __pyx_L6:; + __pyx_L3:; /* "hadoopy/_main.pyx":200 * if work_func == None: @@ -2766,9 +3006,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject __Pyx_DECREF(__pyx_v_work_func); __pyx_v_work_func = __pyx_t_1; __pyx_t_1 = 0; - goto __pyx_L7; + goto __pyx_L4; } - __pyx_L7:; + __pyx_L4:; /* "hadoopy/_main.pyx":202 * if isinstance(work_func, type): @@ -2791,9 +3031,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject * except AttributeError: * pass */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_work_func, __pyx_n_s__configure); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_work_func, __pyx_n_s__configure); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -2801,8 +3041,8 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L15_try_end; - __pyx_L8_error:; + goto __pyx_L12_try_end; + __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -2816,19 +3056,19 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_7) { PyErr_Restore(0,0,0); - goto __pyx_L9_exception_handled; + goto __pyx_L6_exception_handled; } __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; - __pyx_L9_exception_handled:; + __pyx_L6_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); - __pyx_L15_try_end:; + __pyx_L12_try_end:; } /* "hadoopy/_main.pyx":206 @@ -2852,7 +3092,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject * except AttributeError: * call_work_func = work_func */ - __pyx_t_6 = PyObject_GetAttr(__pyx_v_work_func, __pyx_v_attr); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_v_work_func, __pyx_v_attr); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L13_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_v_call_work_func = __pyx_t_6; __pyx_t_6 = 0; @@ -2860,8 +3100,8 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L23_try_end; - __pyx_L16_error:; + goto __pyx_L20_try_end; + __pyx_L13_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -2875,7 +3115,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_7) { __Pyx_AddTraceback("_hadoopy_main.HadoopyTask.process_inout", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_8); @@ -2893,20 +3133,20 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L17_exception_handled; + goto __pyx_L14_exception_handled; } - __pyx_L18_except_error:; + __pyx_L15_except_error:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); goto __pyx_L1_error; - __pyx_L17_exception_handled:; + __pyx_L14_exception_handled:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); - __pyx_L23_try_end:; + __pyx_L20_try_end:; } /* "hadoopy/_main.pyx":210 @@ -2925,10 +3165,10 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; } for (;;) { - if (PyList_CheckExact(__pyx_t_8)) { + if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_8)) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break; __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; - } else if (PyTuple_CheckExact(__pyx_t_8)) { + } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_8)) { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break; __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; } else { @@ -2983,7 +3223,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject * work_iter = work_func.close() */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_work_iter); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_work_iter); __Pyx_GIVEREF(__pyx_v_work_iter); @@ -2991,9 +3231,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L28; + goto __pyx_L25; } - __pyx_L28:; + __pyx_L25:; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -3018,9 +3258,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject * except AttributeError: * pass */ - __pyx_t_8 = PyObject_GetAttr(__pyx_v_work_func, __pyx_n_s__close); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L29_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_v_work_func, __pyx_n_s__close); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L26_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L29_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L26_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_v_work_iter); @@ -3036,9 +3276,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject * out_func(work_iter) * return 0 */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_work_iter, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L31_except_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_work_iter, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L31_except_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { @@ -3049,24 +3289,24 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject * return 0 * */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L31_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_work_iter); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_work_iter); __Pyx_GIVEREF(__pyx_v_work_iter); - __pyx_t_8 = PyObject_Call(__pyx_v_out_func, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L31_except_error;} + __pyx_t_8 = PyObject_Call(__pyx_v_out_func, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L37; + goto __pyx_L34; } - __pyx_L37:; + __pyx_L34:; } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L36_try_end; - __pyx_L29_error:; + goto __pyx_L33_try_end; + __pyx_L26_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3081,20 +3321,20 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_7) { PyErr_Restore(0,0,0); - goto __pyx_L30_exception_handled; + goto __pyx_L27_exception_handled; } - __pyx_L31_except_error:; + __pyx_L28_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; - __pyx_L30_exception_handled:; + __pyx_L27_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); - __pyx_L36_try_end:; + __pyx_L33_try_end:; } /* "hadoopy/_main.pyx":221 @@ -3127,6 +3367,17 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_7print_out_text(PyObject *__pyx_v_self, PyObject *__pyx_v_iter); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_7print_out_text(PyObject *__pyx_v_self, PyObject *__pyx_v_iter) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("print_out_text (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_11HadoopyTask_6print_out_text(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self), ((PyObject *)__pyx_v_iter)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":224 * * # Output methods @@ -3135,8 +3386,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout(PyObject * os.write(self.write_fd, '%s\t%s\n' % (k, v)) */ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_3print_out_text(PyObject *__pyx_v_self, PyObject *__pyx_v_iter); /*proto*/ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_3print_out_text(PyObject *__pyx_v_self, PyObject *__pyx_v_iter) { +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_6print_out_text(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self, PyObject *__pyx_v_iter) { PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; @@ -3152,7 +3402,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_3print_out_text(PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("print_out_text"); + __Pyx_RefNannySetupContext("print_out_text", 0); /* "hadoopy/_main.pyx":225 * # Output methods @@ -3170,10 +3420,10 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_3print_out_text(PyObject __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { - if (PyList_CheckExact(__pyx_t_1)) { + if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; - } else if (PyTuple_CheckExact(__pyx_t_1)) { + } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { @@ -3215,19 +3465,19 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_3print_out_text(PyObject __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; - index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L8_unpacking_done; - __pyx_L7_unpacking_failed:; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L8_unpacking_done:; + __pyx_L6_unpacking_done:; } __Pyx_XDECREF(__pyx_v_k); __pyx_v_k = __pyx_t_5; @@ -3248,10 +3498,10 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_3print_out_text(PyObject __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromLong(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->write_fd); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_self->write_fd); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); @@ -3262,7 +3512,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_3print_out_text(PyObject __Pyx_GOTREF(((PyObject *)__pyx_t_7)); __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_7)); @@ -3295,6 +3545,17 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_3print_out_text(PyObject return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_9print_out_tb(PyObject *__pyx_v_self, PyObject *__pyx_v_iter); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_9print_out_tb(PyObject *__pyx_v_self, PyObject *__pyx_v_iter) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("print_out_tb (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_11HadoopyTask_8print_out_tb(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self), ((PyObject *)__pyx_v_iter)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":228 * os.write(self.write_fd, '%s\t%s\n' % (k, v)) * @@ -3303,8 +3564,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_3print_out_text(PyObject * */ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_4print_out_tb(PyObject *__pyx_v_self, PyObject *__pyx_v_iter); /*proto*/ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_4print_out_tb(PyObject *__pyx_v_self, PyObject *__pyx_v_iter) { +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_8print_out_tb(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self, PyObject *__pyx_v_iter) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -3313,7 +3573,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_4print_out_tb(PyObject * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("print_out_tb"); + __Pyx_RefNannySetupContext("print_out_tb", 0); /* "hadoopy/_main.pyx":229 * @@ -3322,10 +3582,10 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_4print_out_tb(PyObject * * * def print_out(self, iter): */ - __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->tb, __pyx_n_s__writes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->tb, __pyx_n_s__writes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_iter); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_iter); __Pyx_GIVEREF(__pyx_v_iter); @@ -3349,6 +3609,18 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_4print_out_tb(PyObject * return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_11print_out(PyObject *__pyx_v_self, PyObject *__pyx_v_iter); /*proto*/ +static char __pyx_doc_13_hadoopy_main_11HadoopyTask_10print_out[] = "Given an iterator, output the paired values\n\n Args:\n iter: Iterator of (key, value)\n "; +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_11print_out(PyObject *__pyx_v_self, PyObject *__pyx_v_iter) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("print_out (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_11HadoopyTask_10print_out(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self), ((PyObject *)__pyx_v_iter)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":231 * self.tb.writes(iter) * @@ -3357,9 +3629,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_4print_out_tb(PyObject * * */ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_5print_out(PyObject *__pyx_v_self, PyObject *__pyx_v_iter); /*proto*/ -static char __pyx_doc_13_hadoopy_main_11HadoopyTask_5print_out[] = "Given an iterator, output the paired values\n\n Args:\n iter: Iterator of (key, value)\n "; -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_5print_out(PyObject *__pyx_v_self, PyObject *__pyx_v_iter) { +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_10print_out(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self, PyObject *__pyx_v_iter) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -3370,7 +3640,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_5print_out(PyObject *__p int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("print_out"); + __Pyx_RefNannySetupContext("print_out", 0); /* "hadoopy/_main.pyx":237 * iter: Iterator of (key, value) @@ -3379,7 +3649,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_5print_out(PyObject *__p * * # Input methods */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__is_io_typedbytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__is_io_typedbytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -3387,10 +3657,10 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_5print_out(PyObject *__p __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__print_out_tb); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_out_tb); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_iter); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_iter); __Pyx_GIVEREF(__pyx_v_iter); @@ -3401,10 +3671,10 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_5print_out(PyObject *__p __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__print_out_text); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_out_text); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_iter); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_iter); __Pyx_GIVEREF(__pyx_v_iter); @@ -3440,7 +3710,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_5print_out(PyObject *__p * cdef char *lineptr = NULL */ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_6read_key_value_text(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_13read_key_value_text(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_f_13_hadoopy_main_11HadoopyTask_read_key_value_text(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self, int __pyx_skip_dispatch) { Py_ssize_t __pyx_v_sz; char *__pyx_v_lineptr; @@ -3455,14 +3725,14 @@ static PyObject *__pyx_f_13_hadoopy_main_11HadoopyTask_read_key_value_text(struc int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_key_value_text"); + __Pyx_RefNannySetupContext("read_key_value_text", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_key_value_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_13_hadoopy_main_11HadoopyTask_6read_key_value_text)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_13_hadoopy_main_11HadoopyTask_13read_key_value_text)) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); @@ -3616,7 +3886,7 @@ static PyObject *__pyx_f_13_hadoopy_main_11HadoopyTask_read_key_value_text(struc */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); @@ -3642,6 +3912,17 @@ static PyObject *__pyx_f_13_hadoopy_main_11HadoopyTask_read_key_value_text(struc return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_13read_key_value_text(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_13read_key_value_text(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_key_value_text (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_11HadoopyTask_12read_key_value_text(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":240 * * # Input methods @@ -3650,17 +3931,16 @@ static PyObject *__pyx_f_13_hadoopy_main_11HadoopyTask_read_key_value_text(struc * cdef char *lineptr = NULL */ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_6read_key_value_text(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_6read_key_value_text(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_12read_key_value_text(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_key_value_text"); + __Pyx_RefNannySetupContext("read_key_value_text", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_13_hadoopy_main_HadoopyTask *)((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->__pyx_vtab)->read_key_value_text(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_13_hadoopy_main_HadoopyTask *)__pyx_v_self->__pyx_vtab)->read_key_value_text(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3686,7 +3966,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_6read_key_value_text(PyO * cdef char *lineptr = NULL */ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_7read_offset_value_text(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_15read_offset_value_text(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_f_13_hadoopy_main_11HadoopyTask_read_offset_value_text(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self, int __pyx_skip_dispatch) { Py_ssize_t __pyx_v_sz; char *__pyx_v_lineptr; @@ -3701,14 +3981,14 @@ static PyObject *__pyx_f_13_hadoopy_main_11HadoopyTask_read_offset_value_text(st int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_offset_value_text"); + __Pyx_RefNannySetupContext("read_offset_value_text", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_13_hadoopy_main_11HadoopyTask_7read_offset_value_text)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_13_hadoopy_main_11HadoopyTask_15read_offset_value_text)) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); @@ -3820,7 +4100,7 @@ static PyObject *__pyx_f_13_hadoopy_main_11HadoopyTask_read_offset_value_text(st __pyx_t_1 = PyInt_FromLong(__pyx_v_out_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_line); @@ -3845,6 +4125,17 @@ static PyObject *__pyx_f_13_hadoopy_main_11HadoopyTask_read_offset_value_text(st return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_15read_offset_value_text(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_15read_offset_value_text(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_offset_value_text (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_11HadoopyTask_14read_offset_value_text(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":257 * return k, v * @@ -3853,17 +4144,16 @@ static PyObject *__pyx_f_13_hadoopy_main_11HadoopyTask_read_offset_value_text(st * cdef char *lineptr = NULL */ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_7read_offset_value_text(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_7read_offset_value_text(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_14read_offset_value_text(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_offset_value_text"); + __Pyx_RefNannySetupContext("read_offset_value_text", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_13_hadoopy_main_HadoopyTask *)((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->__pyx_vtab)->read_offset_value_text(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_13_hadoopy_main_HadoopyTask *)__pyx_v_self->__pyx_vtab)->read_offset_value_text(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3881,6 +4171,18 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_7read_offset_value_text( return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_17read_in_map(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_13_hadoopy_main_11HadoopyTask_16read_in_map[] = "Provides the input iterator to use\n\n If is_io_typedbytes() is true, then use TypedBytes.\n If is_on_hadoop() is true, then use Text as key\\tvalue\\n.\n Else, then use Text with key as byte offset and value as line (no \\n)\n\n Returns:\n Iterator that can be called to get KeyValue pairs.\n "; +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_17read_in_map(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_in_map (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_11HadoopyTask_16read_in_map(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":270 * return out_count, line * @@ -3889,9 +4191,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_7read_offset_value_text( * */ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_8read_in_map(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_13_hadoopy_main_11HadoopyTask_8read_in_map[] = "Provides the input iterator to use\n\n If is_io_typedbytes() is true, then use TypedBytes.\n If is_on_hadoop() is true, then use Text as key\\tvalue\\n.\n Else, then use Text with key as byte offset and value as line (no \\n)\n\n Returns:\n Iterator that can be called to get KeyValue pairs.\n "; -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_8read_in_map(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_16read_in_map(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -3900,7 +4200,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_8read_in_map(PyObject *_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_in_map"); + __Pyx_RefNannySetupContext("read_in_map", 0); /* "hadoopy/_main.pyx":280 * Iterator that can be called to get KeyValue pairs. @@ -3909,7 +4209,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_8read_in_map(PyObject *_ * return KeyValueStream(self.tb.__next__) * if self.is_on_hadoop(): */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__is_io_typedbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__is_io_typedbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); @@ -3926,10 +4226,10 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_8read_in_map(PyObject *_ * return KeyValueStream(self.read_key_value_text) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->tb, __pyx_n_s____next__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->tb, __pyx_n_s____next__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3939,9 +4239,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_8read_in_map(PyObject *_ __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L3; } - __pyx_L5:; + __pyx_L3:; /* "hadoopy/_main.pyx":282 * if self.is_io_typedbytes(): @@ -3950,7 +4250,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_8read_in_map(PyObject *_ * return KeyValueStream(self.read_key_value_text) * return KeyValueStream(self.read_offset_value_text) */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__is_on_hadoop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__is_on_hadoop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); @@ -3967,10 +4267,10 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_8read_in_map(PyObject *_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__read_key_value_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_key_value_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3980,9 +4280,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_8read_in_map(PyObject *_ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - goto __pyx_L6; + goto __pyx_L4; } - __pyx_L6:; + __pyx_L4:; /* "hadoopy/_main.pyx":284 * if self.is_on_hadoop(): @@ -3992,10 +4292,10 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_8read_in_map(PyObject *_ * def read_in_reduce(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4019,6 +4319,18 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_8read_in_map(PyObject *_ return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_19read_in_reduce(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_13_hadoopy_main_11HadoopyTask_18read_in_reduce[] = "\n Returns:\n Iterator that can be called to get grouped KeyValues.\n "; +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_19read_in_reduce(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_in_reduce (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_11HadoopyTask_18read_in_reduce(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":286 * return KeyValueStream(self.read_offset_value_text) * @@ -4027,9 +4339,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_8read_in_map(PyObject *_ * Returns: */ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_9read_in_reduce(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_13_hadoopy_main_11HadoopyTask_9read_in_reduce[] = "\n Returns:\n Iterator that can be called to get grouped KeyValues.\n "; -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_9read_in_reduce(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_18read_in_reduce(struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -4038,7 +4348,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_9read_in_reduce(PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_in_reduce"); + __Pyx_RefNannySetupContext("read_in_reduce", 0); /* "hadoopy/_main.pyx":291 * Iterator that can be called to get grouped KeyValues. @@ -4047,7 +4357,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_9read_in_reduce(PyObject * return GroupedKeyValues(KeyValueStream(self.tb.__next__)) * return GroupedKeyValues(KeyValueStream(self.read_key_value_text)) */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__is_io_typedbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__is_io_typedbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); @@ -4064,10 +4374,10 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_9read_in_reduce(PyObject * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)->tb, __pyx_n_s____next__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->tb, __pyx_n_s____next__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4075,7 +4385,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_9read_in_reduce(PyObject __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4085,9 +4395,9 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_9read_in_reduce(PyObject __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L3; } - __pyx_L5:; + __pyx_L3:; /* "hadoopy/_main.pyx":293 * if self.is_io_typedbytes(): @@ -4097,10 +4407,10 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_9read_in_reduce(PyObject * # Environment info methods */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__read_key_value_text); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_key_value_text); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4108,7 +4418,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_9read_in_reduce(PyObject __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4132,6 +4442,17 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_9read_in_reduce(PyObject return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_21is_io_typedbytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_21is_io_typedbytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_io_typedbytes (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_11HadoopyTask_20is_io_typedbytes(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":296 * * # Environment info methods @@ -4140,8 +4461,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_9read_in_reduce(PyObject * try: */ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_10is_io_typedbytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_10is_io_typedbytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_20is_io_typedbytes(CYTHON_UNUSED struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -4156,7 +4476,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_10is_io_typedbytes(PyObj int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("is_io_typedbytes"); + __Pyx_RefNannySetupContext("is_io_typedbytes", 0); /* "hadoopy/_main.pyx":298 * def is_io_typedbytes(self): @@ -4180,33 +4500,33 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_10is_io_typedbytes(PyObj * return False */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__environ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__environ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__stream_map_input)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__stream_map_input)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyString_Equals(__pyx_t_4, ((PyObject *)__pyx_n_s__typedbytes), Py_EQ); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_6 = __Pyx_PyString_Equals(__pyx_t_4, ((PyObject *)__pyx_n_s__typedbytes), Py_EQ); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; - goto __pyx_L9_try_return; + goto __pyx_L7_try_return; } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L12_try_end; - __pyx_L9_try_return:; + goto __pyx_L10_try_end; + __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; - __pyx_L5_error:; + __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -4220,7 +4540,7 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_10is_io_typedbytes(PyObj __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_7) { __Pyx_AddTraceback("_hadoopy_main.HadoopyTask.is_io_typedbytes", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_8); @@ -4233,37 +4553,37 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_10is_io_typedbytes(PyObj * def is_on_hadoop(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_9 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __pyx_t_9 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_r = __pyx_t_9; __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L8_except_return; + goto __pyx_L6_except_return; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L6_exception_handled; + goto __pyx_L4_exception_handled; } - __pyx_L7_except_error:; + __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L8_except_return:; + __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; - __pyx_L6_exception_handled:; + __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - __pyx_L12_try_end:; + __pyx_L10_try_end:; } __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4281,15 +4601,26 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_10is_io_typedbytes(PyObj return __pyx_r; } +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_23is_on_hadoop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_23is_on_hadoop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_on_hadoop (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_11HadoopyTask_22is_on_hadoop(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "hadoopy/_main.pyx":303 * return False * * def is_on_hadoop(self): # <<<<<<<<<<<<<< * return 'mapred_input_format_class' in os.environ + * */ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_11is_on_hadoop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_11is_on_hadoop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_22is_on_hadoop(CYTHON_UNUSED struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -4298,12 +4629,14 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_11is_on_hadoop(PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("is_on_hadoop"); + __Pyx_RefNannySetupContext("is_on_hadoop", 0); /* "hadoopy/_main.pyx":304 * * def is_on_hadoop(self): * return 'mapred_input_format_class' in os.environ # <<<<<<<<<<<<<< + * + * def flush_tb_writes(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -4331,6 +4664,67 @@ static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_11is_on_hadoop(PyObject __Pyx_RefNannyFinishContext(); return __pyx_r; } + +/* Python wrapper */ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_25flush_tb_writes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_13_hadoopy_main_11HadoopyTask_25flush_tb_writes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("flush_tb_writes (wrapper)", 0); + __pyx_r = __pyx_pf_13_hadoopy_main_11HadoopyTask_24flush_tb_writes(((struct __pyx_obj_13_hadoopy_main_HadoopyTask *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_main.pyx":306 + * return 'mapred_input_format_class' in os.environ + * + * def flush_tb_writes(self): # <<<<<<<<<<<<<< + * return 'hadoopy_flush_tb_writes' in os.environ + */ + +static PyObject *__pyx_pf_13_hadoopy_main_11HadoopyTask_24flush_tb_writes(CYTHON_UNUSED struct __pyx_obj_13_hadoopy_main_HadoopyTask *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("flush_tb_writes", 0); + + /* "hadoopy/_main.pyx":307 + * + * def flush_tb_writes(self): + * return 'hadoopy_flush_tb_writes' in os.environ # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__environ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = ((PySequence_Contains(__pyx_t_2, ((PyObject *)__pyx_n_s_4)))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("_hadoopy_main.HadoopyTask.flush_tb_writes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} static struct __pyx_vtabstruct_13_hadoopy_main_KeyValueStream __pyx_vtable_13_hadoopy_main_KeyValueStream; static PyObject *__pyx_tp_new_13_hadoopy_main_KeyValueStream(PyTypeObject *t, PyObject *a, PyObject *k) { @@ -4384,8 +4778,8 @@ static int __pyx_tp_clear_13_hadoopy_main_KeyValueStream(PyObject *o) { } static PyMethodDef __pyx_methods_13_hadoopy_main_KeyValueStream[] = { - {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_13_hadoopy_main_14KeyValueStream_2__next__)}, - {__Pyx_NAMESTR("put"), (PyCFunction)__pyx_pf_13_hadoopy_main_14KeyValueStream_3put, METH_O, __Pyx_DOCSTR(__pyx_doc_13_hadoopy_main_14KeyValueStream_3put)}, + {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_13_hadoopy_main_14KeyValueStream_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_13_hadoopy_main_14KeyValueStream_4__next__)}, + {__Pyx_NAMESTR("put"), (PyCFunction)__pyx_pw_13_hadoopy_main_14KeyValueStream_7put, METH_O, __Pyx_DOCSTR(__pyx_doc_13_hadoopy_main_14KeyValueStream_6put)}, {0, 0, 0, 0} }; @@ -4517,8 +4911,8 @@ static PyTypeObject __pyx_type_13_hadoopy_main_KeyValueStream = { __pyx_tp_clear_13_hadoopy_main_KeyValueStream, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pf_13_hadoopy_main_14KeyValueStream_1__iter__, /*tp_iter*/ - __pyx_pf_13_hadoopy_main_14KeyValueStream_2__next__, /*tp_iternext*/ + __pyx_pw_13_hadoopy_main_14KeyValueStream_3__iter__, /*tp_iter*/ + __pyx_pw_13_hadoopy_main_14KeyValueStream_5__next__, /*tp_iternext*/ __pyx_methods_13_hadoopy_main_KeyValueStream, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ @@ -4527,7 +4921,7 @@ static PyTypeObject __pyx_type_13_hadoopy_main_KeyValueStream = { 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_13_hadoopy_main_14KeyValueStream___init__, /*tp_init*/ + __pyx_pw_13_hadoopy_main_14KeyValueStream_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_13_hadoopy_main_KeyValueStream, /*tp_new*/ 0, /*tp_free*/ @@ -4593,7 +4987,7 @@ static int __pyx_tp_clear_13_hadoopy_main_GroupedValues(PyObject *o) { } static PyMethodDef __pyx_methods_13_hadoopy_main_GroupedValues[] = { - {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_13_hadoopy_main_13GroupedValues_2__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_13_hadoopy_main_13GroupedValues_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -4725,8 +5119,8 @@ static PyTypeObject __pyx_type_13_hadoopy_main_GroupedValues = { __pyx_tp_clear_13_hadoopy_main_GroupedValues, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pf_13_hadoopy_main_13GroupedValues_1__iter__, /*tp_iter*/ - __pyx_pf_13_hadoopy_main_13GroupedValues_2__next__, /*tp_iternext*/ + __pyx_pw_13_hadoopy_main_13GroupedValues_3__iter__, /*tp_iter*/ + __pyx_pw_13_hadoopy_main_13GroupedValues_5__next__, /*tp_iternext*/ __pyx_methods_13_hadoopy_main_GroupedValues, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ @@ -4735,7 +5129,7 @@ static PyTypeObject __pyx_type_13_hadoopy_main_GroupedValues = { 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_13_hadoopy_main_13GroupedValues___init__, /*tp_init*/ + __pyx_pw_13_hadoopy_main_13GroupedValues_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_13_hadoopy_main_GroupedValues, /*tp_new*/ 0, /*tp_free*/ @@ -4801,7 +5195,7 @@ static int __pyx_tp_clear_13_hadoopy_main_GroupedKeyValues(PyObject *o) { } static PyMethodDef __pyx_methods_13_hadoopy_main_GroupedKeyValues[] = { - {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_13_hadoopy_main_16GroupedKeyValues_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -4933,8 +5327,8 @@ static PyTypeObject __pyx_type_13_hadoopy_main_GroupedKeyValues = { __pyx_tp_clear_13_hadoopy_main_GroupedKeyValues, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pf_13_hadoopy_main_16GroupedKeyValues_1__iter__, /*tp_iter*/ - __pyx_pf_13_hadoopy_main_16GroupedKeyValues_2__next__, /*tp_iternext*/ + __pyx_pw_13_hadoopy_main_16GroupedKeyValues_3__iter__, /*tp_iter*/ + __pyx_pw_13_hadoopy_main_16GroupedKeyValues_5__next__, /*tp_iternext*/ __pyx_methods_13_hadoopy_main_GroupedKeyValues, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ @@ -4943,7 +5337,7 @@ static PyTypeObject __pyx_type_13_hadoopy_main_GroupedKeyValues = { 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_13_hadoopy_main_16GroupedKeyValues___init__, /*tp_init*/ + __pyx_pw_13_hadoopy_main_16GroupedKeyValues_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_13_hadoopy_main_GroupedKeyValues, /*tp_new*/ 0, /*tp_free*/ @@ -5027,17 +5421,18 @@ static int __pyx_tp_clear_13_hadoopy_main_HadoopyTask(PyObject *o) { } static PyMethodDef __pyx_methods_13_hadoopy_main_HadoopyTask[] = { - {__Pyx_NAMESTR("run"), (PyCFunction)__pyx_pf_13_hadoopy_main_11HadoopyTask_1run, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("process_inout"), (PyCFunction)__pyx_pf_13_hadoopy_main_11HadoopyTask_2process_inout, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("print_out_text"), (PyCFunction)__pyx_pf_13_hadoopy_main_11HadoopyTask_3print_out_text, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("print_out_tb"), (PyCFunction)__pyx_pf_13_hadoopy_main_11HadoopyTask_4print_out_tb, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("print_out"), (PyCFunction)__pyx_pf_13_hadoopy_main_11HadoopyTask_5print_out, METH_O, __Pyx_DOCSTR(__pyx_doc_13_hadoopy_main_11HadoopyTask_5print_out)}, - {__Pyx_NAMESTR("read_key_value_text"), (PyCFunction)__pyx_pf_13_hadoopy_main_11HadoopyTask_6read_key_value_text, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_offset_value_text"), (PyCFunction)__pyx_pf_13_hadoopy_main_11HadoopyTask_7read_offset_value_text, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_in_map"), (PyCFunction)__pyx_pf_13_hadoopy_main_11HadoopyTask_8read_in_map, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_13_hadoopy_main_11HadoopyTask_8read_in_map)}, - {__Pyx_NAMESTR("read_in_reduce"), (PyCFunction)__pyx_pf_13_hadoopy_main_11HadoopyTask_9read_in_reduce, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_13_hadoopy_main_11HadoopyTask_9read_in_reduce)}, - {__Pyx_NAMESTR("is_io_typedbytes"), (PyCFunction)__pyx_pf_13_hadoopy_main_11HadoopyTask_10is_io_typedbytes, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("is_on_hadoop"), (PyCFunction)__pyx_pf_13_hadoopy_main_11HadoopyTask_11is_on_hadoop, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("run"), (PyCFunction)__pyx_pw_13_hadoopy_main_11HadoopyTask_3run, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("process_inout"), (PyCFunction)__pyx_pw_13_hadoopy_main_11HadoopyTask_5process_inout, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("print_out_text"), (PyCFunction)__pyx_pw_13_hadoopy_main_11HadoopyTask_7print_out_text, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("print_out_tb"), (PyCFunction)__pyx_pw_13_hadoopy_main_11HadoopyTask_9print_out_tb, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("print_out"), (PyCFunction)__pyx_pw_13_hadoopy_main_11HadoopyTask_11print_out, METH_O, __Pyx_DOCSTR(__pyx_doc_13_hadoopy_main_11HadoopyTask_10print_out)}, + {__Pyx_NAMESTR("read_key_value_text"), (PyCFunction)__pyx_pw_13_hadoopy_main_11HadoopyTask_13read_key_value_text, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_offset_value_text"), (PyCFunction)__pyx_pw_13_hadoopy_main_11HadoopyTask_15read_offset_value_text, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_in_map"), (PyCFunction)__pyx_pw_13_hadoopy_main_11HadoopyTask_17read_in_map, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_13_hadoopy_main_11HadoopyTask_16read_in_map)}, + {__Pyx_NAMESTR("read_in_reduce"), (PyCFunction)__pyx_pw_13_hadoopy_main_11HadoopyTask_19read_in_reduce, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_13_hadoopy_main_11HadoopyTask_18read_in_reduce)}, + {__Pyx_NAMESTR("is_io_typedbytes"), (PyCFunction)__pyx_pw_13_hadoopy_main_11HadoopyTask_21is_io_typedbytes, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("is_on_hadoop"), (PyCFunction)__pyx_pw_13_hadoopy_main_11HadoopyTask_23is_on_hadoop, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("flush_tb_writes"), (PyCFunction)__pyx_pw_13_hadoopy_main_11HadoopyTask_25flush_tb_writes, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -5179,7 +5574,7 @@ static PyTypeObject __pyx_type_13_hadoopy_main_HadoopyTask = { 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_13_hadoopy_main_11HadoopyTask___init__, /*tp_init*/ + __pyx_pw_13_hadoopy_main_11HadoopyTask_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_13_hadoopy_main_HadoopyTask, /*tp_new*/ 0, /*tp_free*/ @@ -5217,9 +5612,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, {&__pyx_n_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 1}, {&__pyx_n_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 1}, - {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, + {&__pyx_n_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 1}, {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, - {&__pyx_n_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 1}, + {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, + {&__pyx_n_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 1}, {&__pyx_n_s__AttributeError, __pyx_k__AttributeError, sizeof(__pyx_k__AttributeError), 0, 0, 1, 1}, {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1}, {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1}, @@ -5236,6 +5632,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s__configure, __pyx_k__configure, sizeof(__pyx_k__configure), 0, 0, 1, 1}, {&__pyx_n_s__environ, __pyx_k__environ, sizeof(__pyx_k__environ), 0, 0, 1, 1}, {&__pyx_n_s__fileno, __pyx_k__fileno, sizeof(__pyx_k__fileno), 0, 0, 1, 1}, + {&__pyx_n_s__flush_tb_writes, __pyx_k__flush_tb_writes, sizeof(__pyx_k__flush_tb_writes), 0, 0, 1, 1}, + {&__pyx_n_s__flush_writes, __pyx_k__flush_writes, sizeof(__pyx_k__flush_writes), 0, 0, 1, 1}, {&__pyx_n_s__group_key, __pyx_k__group_key, sizeof(__pyx_k__group_key), 0, 0, 1, 1}, {&__pyx_n_s__hadoopy, __pyx_k__hadoopy, sizeof(__pyx_k__hadoopy), 0, 0, 1, 1}, {&__pyx_n_s__in_iter, __pyx_k__in_iter, sizeof(__pyx_k__in_iter), 0, 0, 1, 1}, @@ -5282,7 +5680,7 @@ static int __Pyx_InitCachedBuiltins(void) { static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); __Pyx_RefNannyFinishContext(); return 0; } @@ -5316,12 +5714,18 @@ PyMODINIT_FUNC PyInit__hadoopy_main(void) Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__hadoopy_main(void)"); + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__hadoopy_main(void)", 0); if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #ifdef __pyx_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ @@ -5370,9 +5774,9 @@ PyMODINIT_FUNC PyInit__hadoopy_main(void) { PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_13_hadoopy_main_KeyValueStream, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_13_hadoopy_main_14KeyValueStream_2__next__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_13_hadoopy_main_14KeyValueStream_2__next__.doc = __pyx_doc_13_hadoopy_main_14KeyValueStream_2__next__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_13_hadoopy_main_14KeyValueStream_2__next__; + __pyx_wrapperbase_13_hadoopy_main_14KeyValueStream_4__next__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_13_hadoopy_main_14KeyValueStream_4__next__.doc = __pyx_doc_13_hadoopy_main_14KeyValueStream_4__next__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_13_hadoopy_main_14KeyValueStream_4__next__; } } if (__Pyx_SetVtable(__pyx_type_13_hadoopy_main_KeyValueStream.tp_dict, __pyx_vtabptr_13_hadoopy_main_KeyValueStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5403,7 +5807,7 @@ PyMODINIT_FUNC PyInit__hadoopy_main(void) * __license__ = 'GPL V3' * */ - if (PyObject_SetAttr(__pyx_m, __pyx_n_s____author__, ((PyObject *)__pyx_kp_s_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s____author__, ((PyObject *)__pyx_kp_s_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "hadoopy/_main.pyx":18 * @@ -5412,7 +5816,7 @@ PyMODINIT_FUNC PyInit__hadoopy_main(void) * * import sys */ - if (PyObject_SetAttr(__pyx_m, __pyx_n_s____license__, ((PyObject *)__pyx_kp_s_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s____license__, ((PyObject *)__pyx_kp_s_6)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "hadoopy/_main.pyx":20 * __license__ = 'GPL V3' @@ -5457,7 +5861,7 @@ PyMODINIT_FUNC PyInit__hadoopy_main(void) * * */ - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_6), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_7), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__hadoopy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5507,7 +5911,6 @@ PyMODINIT_FUNC PyInit__hadoopy_main(void) } /* Runtime support code */ - #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; @@ -5564,7 +5967,6 @@ static int __Pyx_ParseOptionalKeywords( Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; - while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; @@ -5574,7 +5976,7 @@ static int __Pyx_ParseOptionalKeywords( #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { + if (unlikely(!PyUnicode_Check(key))) { #endif goto invalid_keyword_type; } else { @@ -5590,7 +5992,6 @@ static int __Pyx_ParseOptionalKeywords( if (*name) { values[name-argnames] = value; } else { - /* unexpected keyword found */ for (name=argnames; name != first_kw_arg; name++) { if (**name == key) goto arg_passed_twice; #if PY_MAJOR_VERSION >= 3 @@ -5640,7 +6041,6 @@ static void __Pyx_RaiseArgtupleInvalid( { Py_ssize_t num_expected; const char *more_or_less; - if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; @@ -5658,9 +6058,9 @@ static void __Pyx_RaiseArgtupleInvalid( } static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; @@ -5670,27 +6070,30 @@ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyOb Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif } - static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif } - #if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - /* cause is unused */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); Py_XINCREF(value); Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ if (tb == Py_None) { Py_DECREF(tb); tb = 0; @@ -5700,7 +6103,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject "raise: arg 3 must be a traceback or None"); goto raise_error; } - /* Next, replace a missing value with None */ if (value == NULL) { value = Py_None; Py_INCREF(value); @@ -5711,13 +6113,11 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject if (!PyType_Check(type)) #endif { - /* Raising an instance. The value should be a dummy. */ if (value != Py_None) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } - /* Normalize to raise , */ Py_DECREF(value); value = type; #if PY_VERSION_HEX < 0x02050000 @@ -5741,7 +6141,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } #endif } - __Pyx_ErrRestore(type, value, tb); return; raise_error: @@ -5750,9 +6149,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(tb); return; } - #else /* Python 3+ */ - static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { if (tb == Py_None) { tb = 0; @@ -5763,7 +6160,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } if (value == Py_None) value = 0; - if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, @@ -5777,7 +6173,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject "raise: exception class must be a subclass of BaseException"); goto bad; } - if (cause) { PyObject *fixed_cause; if (PyExceptionClass_Check(cause)) { @@ -5800,9 +6195,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyException_SetCause(value, fixed_cause); } - PyErr_SetObject(type, value); - if (tb) { PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; @@ -5812,7 +6205,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(tmp_tb); } } - bad: return; } @@ -5863,7 +6255,6 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) return -1; } - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %"PY_FORMAT_SIZE_T"d value%s to unpack", @@ -5900,7 +6291,6 @@ static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, Py_XINCREF(*value); Py_XINCREF(*tb); } - static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); @@ -5915,6 +6305,41 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) Py_XDECREF(tmp_tb); } +static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { + /* It appears that PyMethodDescr_Type is not anywhere exposed in the Python/C API */ + static PyTypeObject *methoddescr_type = NULL; + if (methoddescr_type == NULL) { + PyObject *meth = __Pyx_GetAttrString((PyObject*)&PyList_Type, "append"); + if (!meth) return NULL; + methoddescr_type = Py_TYPE(meth); + Py_DECREF(meth); + } + if (PyObject_TypeCheck(method, methoddescr_type)) { /* cdef classes */ + PyMethodDescrObject *descr = (PyMethodDescrObject *)method; + #if PY_VERSION_HEX < 0x03020000 + PyTypeObject *d_type = descr->d_type; + #else + PyTypeObject *d_type = descr->d_common.d_type; + #endif + return PyDescr_NewClassMethod(d_type, descr->d_method); + } + else if (PyMethod_Check(method)) { /* python classes */ + return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); + } + else if (PyCFunction_Check(method)) { + return PyClassMethod_New(method); + } +#ifdef __Pyx_CyFunction_USED + else if (PyObject_TypeCheck(method, __pyx_CyFunctionType)) { + return PyClassMethod_New(method); + } +#endif + PyErr_Format(PyExc_TypeError, + "Class-level classmethod() can only be called on " + "a method_descriptor or instance method."); + return NULL; +} + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) { PyObject *py_import = 0; PyObject *empty_list = 0; @@ -5941,12 +6366,33 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) { goto bad; #if PY_VERSION_HEX >= 0x02050000 { - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + /* try package relative import first */ + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + } } #else if (level>0) { @@ -5963,43 +6409,8 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) { return module; } -static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { - /* It appears that PyMethodDescr_Type is not anywhere exposed in the Python/C API */ - static PyTypeObject *methoddescr_type = NULL; - if (methoddescr_type == NULL) { - PyObject *meth = __Pyx_GetAttrString((PyObject*)&PyList_Type, "append"); - if (!meth) return NULL; - methoddescr_type = Py_TYPE(meth); - Py_DECREF(meth); - } - if (PyObject_TypeCheck(method, methoddescr_type)) { /* cdef classes */ - PyMethodDescrObject *descr = (PyMethodDescrObject *)method; - #if PY_VERSION_HEX < 0x03020000 - PyTypeObject *d_type = descr->d_type; - #else - PyTypeObject *d_type = descr->d_common.d_type; - #endif - return PyDescr_NewClassMethod(d_type, descr->d_method); - } - else if (PyMethod_Check(method)) { /* python classes */ - return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); - } - else if (PyCFunction_Check(method)) { - return PyClassMethod_New(method); - } -#ifdef __pyx_binding_PyCFunctionType_USED - else if (PyObject_TypeCheck(method, __pyx_binding_PyCFunctionType)) { /* binded CFunction */ - return PyClassMethod_New(method); - } -#endif - PyErr_Format(PyExc_TypeError, - "Class-level classmethod() can only be called on " - "a method_descriptor or instance method."); - return NULL; -} - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { - if (s1 == s2) { /* as done by PyObject_RichCompareBool(); also catches the (interned) empty string */ + if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { if (PyBytes_GET_SIZE(s1) != PyBytes_GET_SIZE(s2)) { @@ -6029,16 +6440,26 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq } static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { - if (s1 == s2) { /* as done by PyObject_RichCompareBool(); also catches the (interned) empty string */ + if (s1 == s2) { return (equals == Py_EQ); } else if (PyUnicode_CheckExact(s1) & PyUnicode_CheckExact(s2)) { + #if CYTHON_PEP393_ENABLED + if ((PyUnicode_READY(s1) < 0) || (PyUnicode_READY(s2) < 0)) + return -1; + if (PyUnicode_GET_LENGTH(s1) != PyUnicode_GET_LENGTH(s2)) { + return (equals == Py_NE); + } else if (PyUnicode_GET_LENGTH(s1) == 1) { + Py_UCS4 ch1 = PyUnicode_READ_CHAR(s1, 0); + Py_UCS4 ch2 = PyUnicode_READ_CHAR(s2, 0); + return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2); + #else if (PyUnicode_GET_SIZE(s1) != PyUnicode_GET_SIZE(s2)) { return (equals == Py_NE); } else if (PyUnicode_GET_SIZE(s1) == 1) { - if (equals == Py_EQ) - return (PyUnicode_AS_UNICODE(s1)[0] == PyUnicode_AS_UNICODE(s2)[0]); - else - return (PyUnicode_AS_UNICODE(s1)[0] != PyUnicode_AS_UNICODE(s2)[0]); + Py_UNICODE ch1 = PyUnicode_AS_UNICODE(s1)[0]; + Py_UNICODE ch2 = PyUnicode_AS_UNICODE(s2)[0]; + return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2); + #endif } else { int result = PyUnicode_Compare(s1, s2); if ((result == -1) && unlikely(PyErr_Occurred())) @@ -6510,29 +6931,105 @@ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { return -1; } +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + #include "compile.h" #include "frameobject.h" #include "traceback.h" - -static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno, - int __pyx_lineno, const char *__pyx_filename) { +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(__pyx_filename); + py_srcfile = PyString_FromString(filename); #else - py_srcfile = PyUnicode_FromString(__pyx_filename); + py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; - if (__pyx_clineno) { + if (c_line) { #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { @@ -6543,28 +7040,45 @@ static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno, #endif } if (!py_funcname) goto bad; - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_code = PyCode_New( + py_code = __Pyx_PyCode_New( 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 0, /*int kwonlyargcount,*/ - #endif 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ - __pyx_lineno, /*int firstlineno,*/ + py_line, /*int firstlineno,*/ __pyx_empty_bytes /*PyObject *lnotab*/ ); - if (!py_code) goto bad; + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ @@ -6572,11 +7086,9 @@ static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno, 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; + py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); Py_XDECREF(py_code); Py_XDECREF(py_frame); } @@ -6611,6 +7123,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { return 0; } + /* Type Conversion Functions */ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { diff --git a/hadoopy/_typedbytes.c b/hadoopy/_typedbytes.c index 63a5b75..a34c32b 100644 --- a/hadoopy/_typedbytes.c +++ b/hadoopy/_typedbytes.c @@ -1,11 +1,12 @@ -/* Generated by Cython 0.15.1 on Mon Mar 19 20:17:44 2012 */ +/* Generated by Cython 0.16 on Fri Aug 3 15:49:43 2012 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. #else - #include /* For offsetof */ #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -34,10 +35,22 @@ #define PY_LONG_LONG LONG_LONG #endif -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif + +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif + +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCFunction_Call PyObject_Call +#else + #define __Pyx_PyCFunction_Call PyCFunction_Call #endif #if PY_VERSION_HEX < 0x02050000 @@ -50,6 +63,9 @@ #define PyNumber_Index(o) PyNumber_Int(o) #define PyIndex_Check(o) PyNumber_Check(o) #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" #endif #if PY_VERSION_HEX < 0x02060000 @@ -83,13 +99,25 @@ #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); #endif #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif + +#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") #endif #if PY_MAJOR_VERSION >= 3 @@ -101,6 +129,17 @@ #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif + +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_GET_LENGTH) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) +#endif + #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject @@ -168,15 +207,6 @@ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) @@ -218,6 +248,14 @@ #define __Pyx_DOCSTR(n) (n) #endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" @@ -266,7 +304,7 @@ # else # define CYTHON_UNUSED # endif -# elif defined(__ICC) || defined(__INTEL_COMPILER) +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED @@ -291,7 +329,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #ifdef __GNUC__ /* Test for GCC > 2.95 */ @@ -324,7 +362,7 @@ static const char *__pyx_f[] = { /*--- Type declarations ---*/ struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile; -/* "hadoopy/_typedbytes.pyx":554 +/* "hadoopy/_typedbytes.pyx":530 * * * cdef class TypedBytesFile(object): # <<<<<<<<<<<<<< @@ -348,11 +386,9 @@ struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile { PyObject *(*flush)(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *__pyx_vtabptr_19_hadoopy_typedbytes_TypedBytesFile; - #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif - #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); @@ -365,8 +401,21 @@ static struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *__pyx_vtabp static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; - #define __Pyx_RefNannySetupContext(name) __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) @@ -377,7 +426,7 @@ static struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *__pyx_vtabp #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name) + #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) @@ -388,6 +437,8 @@ static struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *__pyx_vtabp #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif /* CYTHON_REFNANNY */ +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ @@ -404,10 +455,11 @@ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyOb static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ @@ -473,11 +525,26 @@ static int __Pyx_check_binary_version(void); static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ -static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno, - int __pyx_lineno, const char *__pyx_filename); /*proto*/ +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + /* Module declarations from 'libc.stdint' */ /* Module declarations from '_hadoopy_typedbytes' */ @@ -488,19 +555,15 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_int(void *, static CYTHON_INLINE int64_t __pyx_f_19_hadoopy_typedbytes__read_long(void *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_long(void *, PyObject *); /*proto*/ static CYTHON_INLINE float __pyx_f_19_hadoopy_typedbytes__read_float(void *); /*proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_float(void *, PyObject *); /*proto*/ static CYTHON_INLINE double __pyx_f_19_hadoopy_typedbytes__read_double(void *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_double(void *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_byte(void *); /*proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_byte(void *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_bool(void *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_bool(void *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_bytes(void *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_unicode(void *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_bytes(void *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_unicode(void *, PyObject *); /*proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_string(void *); /*proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_string(void *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_vector(void *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_vector(void *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_list(void *); /*proto*/ @@ -524,6 +587,19 @@ static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_IOError; static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_pf_19_hadoopy_typedbytes_read_tb(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_19_hadoopy_typedbytes_2write_tb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_kv); /* proto */ +static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self, PyObject *__pyx_v_fn, PyObject *__pyx_v_mode, PyObject *__pyx_v_read_fd, PyObject *__pyx_v_write_fd, PyObject *__pyx_v_flush_writes); /* proto */ +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_2__repr__(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_4__enter__(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_6__exit__(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */ +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_8__del__(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_10__iter__(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_12__next__(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_14write(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self, PyObject *__pyx_v_kv); /* proto */ +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_16writes(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self, PyObject *__pyx_v_kvs); /* proto */ +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_18flush(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_20close(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self); /* proto */ static char __pyx_k_1[] = "utf-8"; static char __pyx_k_3[] = "Bad index %d "; static char __pyx_k_5[] = "TypedBytesFile(%s, %s, %s, %s)"; @@ -532,9 +608,11 @@ static char __pyx_k_7[] = "Read pointer not set!"; static char __pyx_k_9[] = "Write pointer not set!"; static char __pyx_k_12[] = "Brandyn A. White "; static char __pyx_k_13[] = "GPL V3"; +static char __pyx_k_15[] = "/home/brandyn/projects/hadoopy/hadoopy/_typedbytes.pyx"; static char __pyx_k__r[] = "r"; static char __pyx_k__w[] = "w"; static char __pyx_k__fn[] = "fn"; +static char __pyx_k__kv[] = "kv"; static char __pyx_k__mode[] = "mode"; static char __pyx_k__type[] = "type"; static char __pyx_k__dumps[] = "dumps"; @@ -579,6 +657,7 @@ static char __pyx_k___hadoopy_typedbytes[] = "_hadoopy_typedbytes"; static PyObject *__pyx_kp_s_1; static PyObject *__pyx_kp_s_12; static PyObject *__pyx_kp_s_13; +static PyObject *__pyx_kp_s_15; static PyObject *__pyx_kp_s_3; static PyObject *__pyx_kp_s_5; static PyObject *__pyx_kp_s_6; @@ -612,6 +691,7 @@ static PyObject *__pyx_n_s__flush; static PyObject *__pyx_n_s__flush_writes; static PyObject *__pyx_n_s__fn; static PyObject *__pyx_n_s__iteritems; +static PyObject *__pyx_n_s__kv; static PyObject *__pyx_n_s__loads; static PyObject *__pyx_n_s__mode; static PyObject *__pyx_n_s__pickle; @@ -646,6 +726,9 @@ static PyObject *__pyx_k_tuple_2; static PyObject *__pyx_k_tuple_8; static PyObject *__pyx_k_tuple_10; static PyObject *__pyx_k_tuple_11; +static PyObject *__pyx_k_tuple_16; +static PyObject *__pyx_k_codeobj_14; +static PyObject *__pyx_k_codeobj_17; /* "hadoopy/_typedbytes.pyx":53 * @@ -659,7 +742,7 @@ static CYTHON_INLINE int32_t __pyx_f_19_hadoopy_typedbytes__read_int(void *__pyx int32_t __pyx_v_val; int32_t __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_read_int"); + __Pyx_RefNannySetupContext("_read_int", 0); /* "hadoopy/_typedbytes.pyx":63 * """ @@ -702,7 +785,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__raw_write_int(void int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_raw_write_int"); + __Pyx_RefNannySetupContext("_raw_write_int", 0); /* "hadoopy/_typedbytes.pyx":76 * OverflowError: If val overflows an int @@ -767,7 +850,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_int(void *__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_write_int"); + __Pyx_RefNannySetupContext("_write_int", 0); /* "hadoopy/_typedbytes.pyx":91 * """ @@ -900,7 +983,7 @@ static CYTHON_INLINE int64_t __pyx_f_19_hadoopy_typedbytes__read_long(void *__py int64_t __pyx_v_val; int64_t __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_read_long"); + __Pyx_RefNannySetupContext("_read_long", 0); /* "hadoopy/_typedbytes.pyx":109 * """ @@ -943,7 +1026,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_long(void *_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_write_long"); + __Pyx_RefNannySetupContext("_write_long", 0); /* "hadoopy/_typedbytes.pyx":122 * val: Python int @@ -996,7 +1079,7 @@ static CYTHON_INLINE float __pyx_f_19_hadoopy_typedbytes__read_float(void *__pyx int32_t __pyx_v_val; float __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_read_float"); + __Pyx_RefNannySetupContext("_read_float", 0); /* "hadoopy/_typedbytes.pyx":137 * """ @@ -1049,7 +1132,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_float(void * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_write_float"); + __Pyx_RefNannySetupContext("_write_float", 0); /* "hadoopy/_typedbytes.pyx":151 * val: Python float @@ -1058,7 +1141,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_float(void * * cdef int32_t cvalo = _htobe32((&cval)[0]) * fwrite(&cvalo, 4, 1, fp) # = 1 */ - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_val); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_cval = __pyx_t_1; /* "hadoopy/_typedbytes.pyx":152 @@ -1102,7 +1185,7 @@ static CYTHON_INLINE double __pyx_f_19_hadoopy_typedbytes__read_double(void *__p int64_t __pyx_v_val; double __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_read_double"); + __Pyx_RefNannySetupContext("_read_double", 0); /* "hadoopy/_typedbytes.pyx":166 * """ @@ -1155,7 +1238,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_double(void int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_write_double"); + __Pyx_RefNannySetupContext("_write_double", 0); /* "hadoopy/_typedbytes.pyx":180 * val: Python float @@ -1213,7 +1296,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_byte(void *__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_read_byte"); + __Pyx_RefNannySetupContext("_read_byte", 0); /* "hadoopy/_typedbytes.pyx":195 * """ @@ -1235,7 +1318,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_byte(void *__ __pyx_t_1 = PyInt_FromLong(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; @@ -1275,7 +1358,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_byte(void *_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_write_byte"); + __Pyx_RefNannySetupContext("_write_byte", 0); /* "hadoopy/_typedbytes.pyx":208 * val: Python int @@ -1323,7 +1406,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_bool(void *__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_read_bool"); + __Pyx_RefNannySetupContext("_read_bool", 0); /* "hadoopy/_typedbytes.pyx":221 * Python Bool @@ -1371,7 +1454,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_bool(void *_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_write_bool"); + __Pyx_RefNannySetupContext("_write_bool", 0); /* "hadoopy/_typedbytes.pyx":233 * val: Python bool @@ -1421,7 +1504,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_bytes(void *_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_read_bytes"); + __Pyx_RefNannySetupContext("_read_bytes", 0); /* "hadoopy/_typedbytes.pyx":246 * Python string of bytes @@ -1498,7 +1581,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_bytes(void *_ /* "hadoopy/_typedbytes.pyx":255 * - * # NOTE(brandyn): This is currently unused to be compatible with Dumbo's typedbytes + * # NOTE(brandyn): This is incompatible with Dumbo's typedbytes as strings and unicode both go to string * cdef inline _read_unicode(void *fp): # <<<<<<<<<<<<<< * """Read bytes * @@ -1515,10 +1598,10 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_unicode(void int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_read_unicode"); + __Pyx_RefNannySetupContext("_read_unicode", 0); /* "hadoopy/_typedbytes.pyx":264 - * Python unicodoe + * Python unicode * """ * sz = _read_int(fp) # <<<<<<<<<<<<<< * cdef char *bytes = malloc(sz) @@ -1574,7 +1657,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_unicode(void */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_out); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_out); __Pyx_GIVEREF(__pyx_v_out); @@ -1620,7 +1703,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_bytes(void * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_write_bytes"); + __Pyx_RefNannySetupContext("_write_bytes", 0); /* "hadoopy/_typedbytes.pyx":283 * cdef char *bytes @@ -1685,7 +1768,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_unicode(void int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_write_unicode"); + __Pyx_RefNannySetupContext("_write_unicode", 0); __Pyx_INCREF(__pyx_v_val); /* "hadoopy/_typedbytes.pyx":299 @@ -1751,89 +1834,6 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_unicode(void } /* "hadoopy/_typedbytes.pyx":305 - * - * - * cdef inline _read_string(void *fp): # <<<<<<<<<<<<<< - * """Read string - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_string(void *__pyx_v_fp) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_read_string"); - - /* "hadoopy/_typedbytes.pyx":314 - * Python string - * """ - * return _read_bytes(fp) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__read_bytes(__pyx_v_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_hadoopy_typedbytes._read_string", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "hadoopy/_typedbytes.pyx":317 - * - * - * cdef inline _write_string(void *fp, val): # <<<<<<<<<<<<<< - * """Write string - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_string(void *__pyx_v_fp, PyObject *__pyx_v_val) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_write_string"); - - /* "hadoopy/_typedbytes.pyx":326 - * val: Python string - * """ - * _write_bytes(fp, val) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__write_bytes(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_hadoopy_typedbytes._write_string", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "hadoopy/_typedbytes.pyx":329 * * * cdef inline _read_vector(void *fp): # <<<<<<<<<<<<<< @@ -1844,7 +1844,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_string(void static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_vector(void *__pyx_v_fp) { int32_t __pyx_v_sz; PyObject *__pyx_v_out = NULL; - int32_t __pyx_v_x; + CYTHON_UNUSED int32_t __pyx_v_x; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -1854,9 +1854,9 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_vector(void * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_read_vector"); + __Pyx_RefNannySetupContext("_read_vector", 0); - /* "hadoopy/_typedbytes.pyx":338 + /* "hadoopy/_typedbytes.pyx":314 * Python tuple with nested values * """ * sz = _read_int(fp) # <<<<<<<<<<<<<< @@ -1865,19 +1865,19 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_vector(void * */ __pyx_v_sz = __pyx_f_19_hadoopy_typedbytes__read_int(__pyx_v_fp); - /* "hadoopy/_typedbytes.pyx":339 + /* "hadoopy/_typedbytes.pyx":315 * """ * sz = _read_int(fp) * out = [] # <<<<<<<<<<<<<< * for x in range(sz): * out.append(_read_tb_code(fp)) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __pyx_v_out = __pyx_t_1; __pyx_t_1 = 0; - /* "hadoopy/_typedbytes.pyx":340 + /* "hadoopy/_typedbytes.pyx":316 * sz = _read_int(fp) * out = [] * for x in range(sz): # <<<<<<<<<<<<<< @@ -1888,23 +1888,20 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_vector(void * for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_x = __pyx_t_3; - /* "hadoopy/_typedbytes.pyx":341 + /* "hadoopy/_typedbytes.pyx":317 * out = [] * for x in range(sz): * out.append(_read_tb_code(fp)) # <<<<<<<<<<<<<< * return tuple(out) * */ - if (unlikely(((PyObject *)__pyx_v_out) == Py_None)) { - PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__read_tb_code(__pyx_v_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__read_tb_code(__pyx_v_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyList_Append(__pyx_v_out, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_Append(__pyx_v_out, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "hadoopy/_typedbytes.pyx":342 + /* "hadoopy/_typedbytes.pyx":318 * for x in range(sz): * out.append(_read_tb_code(fp)) * return tuple(out) # <<<<<<<<<<<<<< @@ -1912,10 +1909,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_vector(void * * */ __Pyx_XDECREF(__pyx_r); - if (unlikely(((PyObject *)__pyx_v_out) == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_1 = ((PyObject *)PyList_AsTuple(__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)PyList_AsTuple(__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_r = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; @@ -1934,7 +1928,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_vector(void * return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":345 +/* "hadoopy/_typedbytes.pyx":321 * * * cdef inline _write_vector(void *fp, val): # <<<<<<<<<<<<<< @@ -1954,33 +1948,33 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_vector(void int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_write_vector"); + __Pyx_RefNannySetupContext("_write_vector", 0); - /* "hadoopy/_typedbytes.pyx":354 + /* "hadoopy/_typedbytes.pyx":330 * val: Python tuple with nested values * """ * cdef int sz = len(val) # <<<<<<<<<<<<<< * _raw_write_int(fp, sz) * for x in val: */ - __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_sz = __pyx_t_1; - /* "hadoopy/_typedbytes.pyx":355 + /* "hadoopy/_typedbytes.pyx":331 * """ * cdef int sz = len(val) * _raw_write_int(fp, sz) # <<<<<<<<<<<<<< * for x in val: * _write_tb_code(fp, x) */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_sz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_sz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_f_19_hadoopy_typedbytes__raw_write_int(__pyx_v_fp, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_19_hadoopy_typedbytes__raw_write_int(__pyx_v_fp, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "hadoopy/_typedbytes.pyx":356 + /* "hadoopy/_typedbytes.pyx":332 * cdef int sz = len(val) * _raw_write_int(fp, sz) * for x in val: # <<<<<<<<<<<<<< @@ -1991,15 +1985,15 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_vector(void __pyx_t_3 = __pyx_v_val; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; } for (;;) { - if (PyList_CheckExact(__pyx_t_3)) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; - } else if (PyTuple_CheckExact(__pyx_t_3)) { + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; } else { @@ -2007,7 +2001,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_vector(void if (unlikely(!__pyx_t_2)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -2017,14 +2011,14 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_vector(void __pyx_v_x = __pyx_t_2; __pyx_t_2 = 0; - /* "hadoopy/_typedbytes.pyx":357 + /* "hadoopy/_typedbytes.pyx":333 * _raw_write_int(fp, sz) * for x in val: * _write_tb_code(fp, x) # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__write_tb_code(__pyx_v_fp, __pyx_v_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__write_tb_code(__pyx_v_fp, __pyx_v_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -2044,7 +2038,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_vector(void return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":360 +/* "hadoopy/_typedbytes.pyx":336 * * * cdef inline _read_list(void *fp): # <<<<<<<<<<<<<< @@ -2067,21 +2061,21 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_list(void *__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_read_list"); + __Pyx_RefNannySetupContext("_read_list", 0); - /* "hadoopy/_typedbytes.pyx":369 + /* "hadoopy/_typedbytes.pyx":345 * Python list of nested values * """ * out = [] # <<<<<<<<<<<<<< * while True: * try: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __pyx_v_out = __pyx_t_1; __pyx_t_1 = 0; - /* "hadoopy/_typedbytes.pyx":370 + /* "hadoopy/_typedbytes.pyx":346 * """ * out = [] * while True: # <<<<<<<<<<<<<< @@ -2091,7 +2085,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_list(void *__ while (1) { if (!1) break; - /* "hadoopy/_typedbytes.pyx":371 + /* "hadoopy/_typedbytes.pyx":347 * out = [] * while True: * try: # <<<<<<<<<<<<<< @@ -2105,19 +2099,16 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_list(void *__ __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { - /* "hadoopy/_typedbytes.pyx":372 + /* "hadoopy/_typedbytes.pyx":348 * while True: * try: * out.append(_read_tb_code(fp)) # <<<<<<<<<<<<<< * except StopIteration: * break */ - if (unlikely(((PyObject *)__pyx_v_out) == Py_None)) { - PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - } - __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__read_tb_code(__pyx_v_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__read_tb_code(__pyx_v_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyList_Append(__pyx_v_out, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_5 = PyList_Append(__pyx_v_out, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -2127,7 +2118,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_list(void *__ __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "hadoopy/_typedbytes.pyx":373 + /* "hadoopy/_typedbytes.pyx":349 * try: * out.append(_read_tb_code(fp)) * except StopIteration: # <<<<<<<<<<<<<< @@ -2137,12 +2128,12 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_list(void *__ __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_6) { __Pyx_AddTraceback("_hadoopy_typedbytes._read_list", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); - /* "hadoopy/_typedbytes.pyx":374 + /* "hadoopy/_typedbytes.pyx":350 * out.append(_read_tb_code(fp)) * except StopIteration: * break # <<<<<<<<<<<<<< @@ -2182,7 +2173,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_list(void *__ } __pyx_L4_break:; - /* "hadoopy/_typedbytes.pyx":375 + /* "hadoopy/_typedbytes.pyx":351 * except StopIteration: * break * return out # <<<<<<<<<<<<<< @@ -2209,7 +2200,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_list(void *__ return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":378 +/* "hadoopy/_typedbytes.pyx":354 * * * cdef inline _write_list(void *fp, val): # <<<<<<<<<<<<<< @@ -2229,9 +2220,9 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_list(void *_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_write_list"); + __Pyx_RefNannySetupContext("_write_list", 0); - /* "hadoopy/_typedbytes.pyx":387 + /* "hadoopy/_typedbytes.pyx":363 * val: Python list of nested values * """ * for x in val: # <<<<<<<<<<<<<< @@ -2242,15 +2233,15 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_list(void *_ __pyx_t_1 = __pyx_v_val; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { - if (PyList_CheckExact(__pyx_t_1)) { + if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; - } else if (PyTuple_CheckExact(__pyx_t_1)) { + } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { @@ -2258,7 +2249,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_list(void *_ if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -2268,20 +2259,20 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_list(void *_ __pyx_v_x = __pyx_t_4; __pyx_t_4 = 0; - /* "hadoopy/_typedbytes.pyx":388 + /* "hadoopy/_typedbytes.pyx":364 * """ * for x in val: * _write_tb_code(fp, x) # <<<<<<<<<<<<<< * cdef unsigned char code = 255 * fwrite(&code, 1, 1, fp) # = 1 */ - __pyx_t_4 = __pyx_f_19_hadoopy_typedbytes__write_tb_code(__pyx_v_fp, __pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_f_19_hadoopy_typedbytes__write_tb_code(__pyx_v_fp, __pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "hadoopy/_typedbytes.pyx":389 + /* "hadoopy/_typedbytes.pyx":365 * for x in val: * _write_tb_code(fp, x) * cdef unsigned char code = 255 # <<<<<<<<<<<<<< @@ -2290,7 +2281,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_list(void *_ */ __pyx_v_code = 255; - /* "hadoopy/_typedbytes.pyx":390 + /* "hadoopy/_typedbytes.pyx":366 * _write_tb_code(fp, x) * cdef unsigned char code = 255 * fwrite(&code, 1, 1, fp) # = 1 # <<<<<<<<<<<<<< @@ -2313,7 +2304,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_list(void *_ return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":393 +/* "hadoopy/_typedbytes.pyx":369 * * * cdef inline _read_map(void *fp): # <<<<<<<<<<<<<< @@ -2324,7 +2315,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_list(void *_ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_map(void *__pyx_v_fp) { int32_t __pyx_v_sz; PyObject *__pyx_v_out = NULL; - int32_t __pyx_v_x; + CYTHON_UNUSED int32_t __pyx_v_x; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; @@ -2336,9 +2327,9 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_map(void *__p int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_read_map"); + __Pyx_RefNannySetupContext("_read_map", 0); - /* "hadoopy/_typedbytes.pyx":402 + /* "hadoopy/_typedbytes.pyx":378 * Python dict with nested values * """ * sz = _read_int(fp) # <<<<<<<<<<<<<< @@ -2347,19 +2338,19 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_map(void *__p */ __pyx_v_sz = __pyx_f_19_hadoopy_typedbytes__read_int(__pyx_v_fp); - /* "hadoopy/_typedbytes.pyx":403 + /* "hadoopy/_typedbytes.pyx":379 * """ * sz = _read_int(fp) * out = {} # <<<<<<<<<<<<<< * for x in range(sz): * k, v = _read_tb_code(fp), _read_tb_code(fp) */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_out = __pyx_t_1; __pyx_t_1 = 0; - /* "hadoopy/_typedbytes.pyx":404 + /* "hadoopy/_typedbytes.pyx":380 * sz = _read_int(fp) * out = {} * for x in range(sz): # <<<<<<<<<<<<<< @@ -2370,16 +2361,16 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_map(void *__p for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_x = __pyx_t_3; - /* "hadoopy/_typedbytes.pyx":405 + /* "hadoopy/_typedbytes.pyx":381 * out = {} * for x in range(sz): * k, v = _read_tb_code(fp), _read_tb_code(fp) # <<<<<<<<<<<<<< * out[k] = v * return out */ - __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__read_tb_code(__pyx_v_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__read_tb_code(__pyx_v_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __pyx_f_19_hadoopy_typedbytes__read_tb_code(__pyx_v_fp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_f_19_hadoopy_typedbytes__read_tb_code(__pyx_v_fp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_v_k); __pyx_v_k = __pyx_t_1; @@ -2388,17 +2379,17 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_map(void *__p __pyx_v_v = __pyx_t_4; __pyx_t_4 = 0; - /* "hadoopy/_typedbytes.pyx":406 + /* "hadoopy/_typedbytes.pyx":382 * for x in range(sz): * k, v = _read_tb_code(fp), _read_tb_code(fp) * out[k] = v # <<<<<<<<<<<<<< * return out * */ - if (PyDict_SetItem(((PyObject *)__pyx_v_out), __pyx_v_k, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(((PyObject *)__pyx_v_out), __pyx_v_k, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "hadoopy/_typedbytes.pyx":407 + /* "hadoopy/_typedbytes.pyx":383 * k, v = _read_tb_code(fp), _read_tb_code(fp) * out[k] = v * return out # <<<<<<<<<<<<<< @@ -2426,7 +2417,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_map(void *__p return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":410 +/* "hadoopy/_typedbytes.pyx":386 * * * cdef inline _write_map(void *fp, val): # <<<<<<<<<<<<<< @@ -2450,49 +2441,49 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_map(void *__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_write_map"); + __Pyx_RefNannySetupContext("_write_map", 0); - /* "hadoopy/_typedbytes.pyx":419 + /* "hadoopy/_typedbytes.pyx":395 * val: Python dict with nested values * """ * _raw_write_int(fp, len(val)) # <<<<<<<<<<<<<< * for x, y in val.iteritems(): * _write_tb_code(fp, x) */ - __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_f_19_hadoopy_typedbytes__raw_write_int(__pyx_v_fp, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_19_hadoopy_typedbytes__raw_write_int(__pyx_v_fp, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "hadoopy/_typedbytes.pyx":420 + /* "hadoopy/_typedbytes.pyx":396 * """ * _raw_write_int(fp, len(val)) * for x, y in val.iteritems(): # <<<<<<<<<<<<<< * _write_tb_code(fp, x) * _write_tb_code(fp, y) */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { - if (PyList_CheckExact(__pyx_t_3)) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; - } else if (PyTuple_CheckExact(__pyx_t_3)) { + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; } else { @@ -2500,7 +2491,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_map(void *__ if (unlikely(!__pyx_t_2)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -2512,7 +2503,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_map(void *__ if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); @@ -2520,7 +2511,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_map(void *__ if (unlikely(PyList_GET_SIZE(sequence) != 2)) { if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); @@ -2530,7 +2521,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_map(void *__ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -2538,14 +2529,14 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_map(void *__ __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF(__pyx_v_x); @@ -2555,25 +2546,25 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_map(void *__ __pyx_v_y = __pyx_t_6; __pyx_t_6 = 0; - /* "hadoopy/_typedbytes.pyx":421 + /* "hadoopy/_typedbytes.pyx":397 * _raw_write_int(fp, len(val)) * for x, y in val.iteritems(): * _write_tb_code(fp, x) # <<<<<<<<<<<<<< * _write_tb_code(fp, y) * */ - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__write_tb_code(__pyx_v_fp, __pyx_v_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__write_tb_code(__pyx_v_fp, __pyx_v_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "hadoopy/_typedbytes.pyx":422 + /* "hadoopy/_typedbytes.pyx":398 * for x, y in val.iteritems(): * _write_tb_code(fp, x) * _write_tb_code(fp, y) # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__write_tb_code(__pyx_v_fp, __pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__write_tb_code(__pyx_v_fp, __pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -2597,7 +2588,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_map(void *__ return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":425 +/* "hadoopy/_typedbytes.pyx":401 * * * cdef inline _read_pickle(void *fp): # <<<<<<<<<<<<<< @@ -2614,9 +2605,9 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_pickle(void * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_read_pickle"); + __Pyx_RefNannySetupContext("_read_pickle", 0); - /* "hadoopy/_typedbytes.pyx":434 + /* "hadoopy/_typedbytes.pyx":410 * Python object * """ * return pickle.loads(_read_bytes(fp)) # <<<<<<<<<<<<<< @@ -2624,19 +2615,19 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_pickle(void * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pickle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pickle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__loads); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__loads); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__read_bytes(__pyx_v_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__read_bytes(__pyx_v_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; @@ -2658,7 +2649,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__read_pickle(void * return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":437 +/* "hadoopy/_typedbytes.pyx":413 * * * cdef inline _write_pickle(void *fp, val): # <<<<<<<<<<<<<< @@ -2675,33 +2666,33 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_pickle(void int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_write_pickle"); + __Pyx_RefNannySetupContext("_write_pickle", 0); - /* "hadoopy/_typedbytes.pyx":446 + /* "hadoopy/_typedbytes.pyx":422 * val: Python object * """ * _write_bytes(fp, pickle.dumps(val, -1)) # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pickle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pickle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__dumps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__dumps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__write_bytes(__pyx_v_fp, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__write_bytes(__pyx_v_fp, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -2720,7 +2711,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19_hadoopy_typedbytes__write_pickle(void return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":463 +/* "hadoopy/_typedbytes.pyx":439 * * * cdef _write_tb_code(void *fp, val): # <<<<<<<<<<<<<< @@ -2746,9 +2737,9 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_write_tb_code"); + __Pyx_RefNannySetupContext("_write_tb_code", 0); - /* "hadoopy/_typedbytes.pyx":465 + /* "hadoopy/_typedbytes.pyx":441 * cdef _write_tb_code(void *fp, val): * cdef int type_code * try: # <<<<<<<<<<<<<< @@ -2762,19 +2753,19 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "hadoopy/_typedbytes.pyx":466 + /* "hadoopy/_typedbytes.pyx":442 * cdef int type_code * try: * type_code = _out_types[type(val)] # <<<<<<<<<<<<<< * except KeyError: * type_code = 100 */ - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___out_types); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___out_types); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_GetItem(__pyx_t_4, ((PyObject *)Py_TYPE(__pyx_v_val))); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_t_4, ((PyObject *)Py_TYPE(__pyx_v_val))); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_type_code = __pyx_t_6; } @@ -2786,7 +2777,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "hadoopy/_typedbytes.pyx":467 + /* "hadoopy/_typedbytes.pyx":443 * try: * type_code = _out_types[type(val)] * except KeyError: # <<<<<<<<<<<<<< @@ -2796,12 +2787,12 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("_hadoopy_typedbytes._write_tb_code", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_7); - /* "hadoopy/_typedbytes.pyx":468 + /* "hadoopy/_typedbytes.pyx":444 * type_code = _out_types[type(val)] * except KeyError: * type_code = 100 # <<<<<<<<<<<<<< @@ -2828,7 +2819,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, __pyx_L10_try_end:; } - /* "hadoopy/_typedbytes.pyx":469 + /* "hadoopy/_typedbytes.pyx":445 * except KeyError: * type_code = 100 * if type_code == 3 and (val < -2147483648 or 2147483647 < val): # <<<<<<<<<<<<<< @@ -2837,14 +2828,14 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, */ __pyx_t_8 = (__pyx_v_type_code == 3); if (__pyx_t_8) { - __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_int_neg_2147483648, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_int_neg_2147483648, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_9) { - __pyx_t_7 = PyObject_RichCompare(__pyx_int_2147483647, __pyx_v_val, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_int_2147483647, __pyx_v_val, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_11 = __pyx_t_10; } else { @@ -2856,7 +2847,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, } if (__pyx_t_9) { - /* "hadoopy/_typedbytes.pyx":470 + /* "hadoopy/_typedbytes.pyx":446 * type_code = 100 * if type_code == 3 and (val < -2147483648 or 2147483647 < val): * type_code = 4 # <<<<<<<<<<<<<< @@ -2868,7 +2859,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, } __pyx_L13:; - /* "hadoopy/_typedbytes.pyx":471 + /* "hadoopy/_typedbytes.pyx":447 * if type_code == 3 and (val < -2147483648 or 2147483647 < val): * type_code = 4 * if type_code == 4 and (val < -9223372036854775808L or 9223372036854775807L < val): # <<<<<<<<<<<<<< @@ -2877,14 +2868,14 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, */ __pyx_t_9 = (__pyx_v_type_code == 4); if (__pyx_t_9) { - __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_int_neg_9223372036854775808, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_int_neg_9223372036854775808, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_8) { - __pyx_t_7 = PyObject_RichCompare(__pyx_int_9223372036854775807L, __pyx_v_val, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_int_9223372036854775807L, __pyx_v_val, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_10 = __pyx_t_11; } else { @@ -2896,7 +2887,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, } if (__pyx_t_8) { - /* "hadoopy/_typedbytes.pyx":472 + /* "hadoopy/_typedbytes.pyx":448 * type_code = 4 * if type_code == 4 and (val < -9223372036854775808L or 9223372036854775807L < val): * type_code = 100 # <<<<<<<<<<<<<< @@ -2908,7 +2899,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, } __pyx_L14:; - /* "hadoopy/_typedbytes.pyx":473 + /* "hadoopy/_typedbytes.pyx":449 * if type_code == 4 and (val < -9223372036854775808L or 9223372036854775807L < val): * type_code = 100 * fwrite(&type_code, 1, 1, fp) # = 1 # <<<<<<<<<<<<<< @@ -2917,16 +2908,16 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, */ fwrite((&__pyx_v_type_code), 1, 1, __pyx_v_fp); - /* "hadoopy/_typedbytes.pyx":493 - * elif type_code == 100: + /* "hadoopy/_typedbytes.pyx":469 + * elif type_code == 10: + * _write_map(fp, val) + * elif type_code == 100: # <<<<<<<<<<<<<< * _write_pickle(fp, val) - * elif type_code == 7: # and isinstance(val, unicode) # <<<<<<<<<<<<<< - * _write_unicode(fp, val) * else: */ switch (__pyx_v_type_code) { - /* "hadoopy/_typedbytes.pyx":475 + /* "hadoopy/_typedbytes.pyx":451 * fwrite(&type_code, 1, 1, fp) # = 1 * # TODO Use a func pointer array * if type_code == 0: # <<<<<<<<<<<<<< @@ -2935,19 +2926,19 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, */ case 0: - /* "hadoopy/_typedbytes.pyx":476 + /* "hadoopy/_typedbytes.pyx":452 * # TODO Use a func pointer array * if type_code == 0: * _write_bytes(fp, val) # <<<<<<<<<<<<<< * elif type_code == 2: * _write_bool(fp, val) */ - __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_bytes(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_bytes(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; break; - /* "hadoopy/_typedbytes.pyx":477 + /* "hadoopy/_typedbytes.pyx":453 * if type_code == 0: * _write_bytes(fp, val) * elif type_code == 2: # <<<<<<<<<<<<<< @@ -2956,19 +2947,19 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, */ case 2: - /* "hadoopy/_typedbytes.pyx":478 + /* "hadoopy/_typedbytes.pyx":454 * _write_bytes(fp, val) * elif type_code == 2: * _write_bool(fp, val) # <<<<<<<<<<<<<< * elif type_code == 3: * _write_int(fp, val) */ - __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_bool(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_bool(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; break; - /* "hadoopy/_typedbytes.pyx":479 + /* "hadoopy/_typedbytes.pyx":455 * elif type_code == 2: * _write_bool(fp, val) * elif type_code == 3: # <<<<<<<<<<<<<< @@ -2977,19 +2968,19 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, */ case 3: - /* "hadoopy/_typedbytes.pyx":480 + /* "hadoopy/_typedbytes.pyx":456 * _write_bool(fp, val) * elif type_code == 3: * _write_int(fp, val) # <<<<<<<<<<<<<< * elif type_code == 4: * _write_long(fp, val) */ - __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_int(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_int(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; break; - /* "hadoopy/_typedbytes.pyx":481 + /* "hadoopy/_typedbytes.pyx":457 * elif type_code == 3: * _write_int(fp, val) * elif type_code == 4: # <<<<<<<<<<<<<< @@ -2998,61 +2989,82 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, */ case 4: - /* "hadoopy/_typedbytes.pyx":482 + /* "hadoopy/_typedbytes.pyx":458 * _write_int(fp, val) * elif type_code == 4: * _write_long(fp, val) # <<<<<<<<<<<<<< * elif type_code == 6: * _write_double(fp, val) */ - __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_long(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_long(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; break; - /* "hadoopy/_typedbytes.pyx":483 + /* "hadoopy/_typedbytes.pyx":459 * elif type_code == 4: * _write_long(fp, val) * elif type_code == 6: # <<<<<<<<<<<<<< * _write_double(fp, val) - * elif type_code == 8: + * elif type_code == 7: */ case 6: - /* "hadoopy/_typedbytes.pyx":484 + /* "hadoopy/_typedbytes.pyx":460 * _write_long(fp, val) * elif type_code == 6: * _write_double(fp, val) # <<<<<<<<<<<<<< - * elif type_code == 8: - * _write_vector(fp, val) + * elif type_code == 7: + * _write_unicode(fp, val) */ - __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_double(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_double(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; break; - /* "hadoopy/_typedbytes.pyx":485 + /* "hadoopy/_typedbytes.pyx":461 * elif type_code == 6: * _write_double(fp, val) + * elif type_code == 7: # <<<<<<<<<<<<<< + * _write_unicode(fp, val) + * elif type_code == 8: + */ + case 7: + + /* "hadoopy/_typedbytes.pyx":462 + * _write_double(fp, val) + * elif type_code == 7: + * _write_unicode(fp, val) # <<<<<<<<<<<<<< + * elif type_code == 8: + * _write_vector(fp, val) + */ + __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_unicode(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + break; + + /* "hadoopy/_typedbytes.pyx":463 + * elif type_code == 7: + * _write_unicode(fp, val) * elif type_code == 8: # <<<<<<<<<<<<<< * _write_vector(fp, val) * elif type_code == 9: */ case 8: - /* "hadoopy/_typedbytes.pyx":486 - * _write_double(fp, val) + /* "hadoopy/_typedbytes.pyx":464 + * _write_unicode(fp, val) * elif type_code == 8: * _write_vector(fp, val) # <<<<<<<<<<<<<< * elif type_code == 9: * _write_list(fp, val) */ - __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_vector(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_vector(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; break; - /* "hadoopy/_typedbytes.pyx":487 + /* "hadoopy/_typedbytes.pyx":465 * elif type_code == 8: * _write_vector(fp, val) * elif type_code == 9: # <<<<<<<<<<<<<< @@ -3061,19 +3073,19 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, */ case 9: - /* "hadoopy/_typedbytes.pyx":488 + /* "hadoopy/_typedbytes.pyx":466 * _write_vector(fp, val) * elif type_code == 9: * _write_list(fp, val) # <<<<<<<<<<<<<< * elif type_code == 10: * _write_map(fp, val) */ - __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_list(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_list(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; break; - /* "hadoopy/_typedbytes.pyx":489 + /* "hadoopy/_typedbytes.pyx":467 * elif type_code == 9: * _write_list(fp, val) * elif type_code == 10: # <<<<<<<<<<<<<< @@ -3082,84 +3094,63 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, */ case 10: - /* "hadoopy/_typedbytes.pyx":490 + /* "hadoopy/_typedbytes.pyx":468 * _write_list(fp, val) * elif type_code == 10: * _write_map(fp, val) # <<<<<<<<<<<<<< * elif type_code == 100: * _write_pickle(fp, val) */ - __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_map(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_map(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; break; - /* "hadoopy/_typedbytes.pyx":491 + /* "hadoopy/_typedbytes.pyx":469 * elif type_code == 10: * _write_map(fp, val) * elif type_code == 100: # <<<<<<<<<<<<<< * _write_pickle(fp, val) - * elif type_code == 7: # and isinstance(val, unicode) + * else: */ case 100: - /* "hadoopy/_typedbytes.pyx":492 + /* "hadoopy/_typedbytes.pyx":470 * _write_map(fp, val) * elif type_code == 100: * _write_pickle(fp, val) # <<<<<<<<<<<<<< - * elif type_code == 7: # and isinstance(val, unicode) - * _write_unicode(fp, val) - */ - __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_pickle(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - break; - - /* "hadoopy/_typedbytes.pyx":493 - * elif type_code == 100: - * _write_pickle(fp, val) - * elif type_code == 7: # and isinstance(val, unicode) # <<<<<<<<<<<<<< - * _write_unicode(fp, val) - * else: - */ - case 7: - - /* "hadoopy/_typedbytes.pyx":494 - * _write_pickle(fp, val) - * elif type_code == 7: # and isinstance(val, unicode) - * _write_unicode(fp, val) # <<<<<<<<<<<<<< * else: * raise IndexError('Bad index %d ' % type_code) */ - __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_unicode(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_19_hadoopy_typedbytes__write_pickle(__pyx_v_fp, __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; break; default: - /* "hadoopy/_typedbytes.pyx":496 - * _write_unicode(fp, val) + /* "hadoopy/_typedbytes.pyx":472 + * _write_pickle(fp, val) * else: * raise IndexError('Bad index %d ' % type_code) # <<<<<<<<<<<<<< * * */ - __pyx_t_7 = PyInt_FromLong(__pyx_v_type_code); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyInt_FromLong(__pyx_v_type_code); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } @@ -3177,7 +3168,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__write_tb_code(void *__pyx_v_fp, return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":499 +/* "hadoopy/_typedbytes.pyx":475 * * * cdef _read_tb_code(void *fp): # <<<<<<<<<<<<<< @@ -3195,9 +3186,9 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_read_tb_code"); + __Pyx_RefNannySetupContext("_read_tb_code", 0); - /* "hadoopy/_typedbytes.pyx":500 + /* "hadoopy/_typedbytes.pyx":476 * * cdef _read_tb_code(void *fp): * cdef int type_code = getc(fp) # <<<<<<<<<<<<<< @@ -3206,7 +3197,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { */ __pyx_v_type_code = getc(__pyx_v_fp); - /* "hadoopy/_typedbytes.pyx":502 + /* "hadoopy/_typedbytes.pyx":478 * cdef int type_code = getc(fp) * # TODO Use a func pointer array * if type_code == 0: # <<<<<<<<<<<<<< @@ -3216,7 +3207,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { __pyx_t_1 = (__pyx_v_type_code == 0); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":503 + /* "hadoopy/_typedbytes.pyx":479 * # TODO Use a func pointer array * if type_code == 0: * return _read_bytes(fp) # <<<<<<<<<<<<<< @@ -3224,7 +3215,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { * return _read_byte(fp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_bytes(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_bytes(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3232,7 +3223,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":504 + /* "hadoopy/_typedbytes.pyx":480 * if type_code == 0: * return _read_bytes(fp) * elif type_code == 1: # <<<<<<<<<<<<<< @@ -3242,7 +3233,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { __pyx_t_1 = (__pyx_v_type_code == 1); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":505 + /* "hadoopy/_typedbytes.pyx":481 * return _read_bytes(fp) * elif type_code == 1: * return _read_byte(fp) # <<<<<<<<<<<<<< @@ -3250,7 +3241,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { * return _read_bool(fp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_byte(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_byte(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3258,7 +3249,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":506 + /* "hadoopy/_typedbytes.pyx":482 * elif type_code == 1: * return _read_byte(fp) * elif type_code == 2: # <<<<<<<<<<<<<< @@ -3268,7 +3259,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { __pyx_t_1 = (__pyx_v_type_code == 2); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":507 + /* "hadoopy/_typedbytes.pyx":483 * return _read_byte(fp) * elif type_code == 2: * return _read_bool(fp) # <<<<<<<<<<<<<< @@ -3276,7 +3267,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { * return _read_int(fp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_bool(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_bool(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3284,7 +3275,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":508 + /* "hadoopy/_typedbytes.pyx":484 * elif type_code == 2: * return _read_bool(fp) * elif type_code == 3: # <<<<<<<<<<<<<< @@ -3294,7 +3285,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { __pyx_t_1 = (__pyx_v_type_code == 3); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":509 + /* "hadoopy/_typedbytes.pyx":485 * return _read_bool(fp) * elif type_code == 3: * return _read_int(fp) # <<<<<<<<<<<<<< @@ -3302,7 +3293,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { * return _read_long(fp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_to_py_int32_t(__pyx_f_19_hadoopy_typedbytes__read_int(__pyx_v_fp)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_to_py_int32_t(__pyx_f_19_hadoopy_typedbytes__read_int(__pyx_v_fp)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3310,7 +3301,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":510 + /* "hadoopy/_typedbytes.pyx":486 * elif type_code == 3: * return _read_int(fp) * elif type_code == 4: # <<<<<<<<<<<<<< @@ -3320,7 +3311,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { __pyx_t_1 = (__pyx_v_type_code == 4); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":511 + /* "hadoopy/_typedbytes.pyx":487 * return _read_int(fp) * elif type_code == 4: * return _read_long(fp) # <<<<<<<<<<<<<< @@ -3328,7 +3319,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { * return _read_float(fp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_to_py_int64_t(__pyx_f_19_hadoopy_typedbytes__read_long(__pyx_v_fp)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_to_py_int64_t(__pyx_f_19_hadoopy_typedbytes__read_long(__pyx_v_fp)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3336,7 +3327,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":512 + /* "hadoopy/_typedbytes.pyx":488 * elif type_code == 4: * return _read_long(fp) * elif type_code == 5: # <<<<<<<<<<<<<< @@ -3346,7 +3337,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { __pyx_t_1 = (__pyx_v_type_code == 5); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":513 + /* "hadoopy/_typedbytes.pyx":489 * return _read_long(fp) * elif type_code == 5: * return _read_float(fp) # <<<<<<<<<<<<<< @@ -3354,7 +3345,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { * return _read_double(fp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_f_19_hadoopy_typedbytes__read_float(__pyx_v_fp)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble(__pyx_f_19_hadoopy_typedbytes__read_float(__pyx_v_fp)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3362,7 +3353,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":514 + /* "hadoopy/_typedbytes.pyx":490 * elif type_code == 5: * return _read_float(fp) * elif type_code == 6: # <<<<<<<<<<<<<< @@ -3372,15 +3363,15 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { __pyx_t_1 = (__pyx_v_type_code == 6); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":515 + /* "hadoopy/_typedbytes.pyx":491 * return _read_float(fp) * elif type_code == 6: * return _read_double(fp) # <<<<<<<<<<<<<< * elif type_code == 7: - * return _read_bytes(fp) + * return _read_unicode(fp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_f_19_hadoopy_typedbytes__read_double(__pyx_v_fp)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble(__pyx_f_19_hadoopy_typedbytes__read_double(__pyx_v_fp)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3388,25 +3379,25 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":516 + /* "hadoopy/_typedbytes.pyx":492 * elif type_code == 6: * return _read_double(fp) * elif type_code == 7: # <<<<<<<<<<<<<< - * return _read_bytes(fp) + * return _read_unicode(fp) * elif type_code == 8: */ __pyx_t_1 = (__pyx_v_type_code == 7); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":517 + /* "hadoopy/_typedbytes.pyx":493 * return _read_double(fp) * elif type_code == 7: - * return _read_bytes(fp) # <<<<<<<<<<<<<< + * return _read_unicode(fp) # <<<<<<<<<<<<<< * elif type_code == 8: * return _read_vector(fp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_bytes(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_unicode(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3414,9 +3405,9 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":518 + /* "hadoopy/_typedbytes.pyx":494 * elif type_code == 7: - * return _read_bytes(fp) + * return _read_unicode(fp) * elif type_code == 8: # <<<<<<<<<<<<<< * return _read_vector(fp) * elif type_code == 9: @@ -3424,15 +3415,15 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { __pyx_t_1 = (__pyx_v_type_code == 8); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":519 - * return _read_bytes(fp) + /* "hadoopy/_typedbytes.pyx":495 + * return _read_unicode(fp) * elif type_code == 8: * return _read_vector(fp) # <<<<<<<<<<<<<< * elif type_code == 9: * return _read_list(fp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_vector(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_vector(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3440,7 +3431,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":520 + /* "hadoopy/_typedbytes.pyx":496 * elif type_code == 8: * return _read_vector(fp) * elif type_code == 9: # <<<<<<<<<<<<<< @@ -3450,7 +3441,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { __pyx_t_1 = (__pyx_v_type_code == 9); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":521 + /* "hadoopy/_typedbytes.pyx":497 * return _read_vector(fp) * elif type_code == 9: * return _read_list(fp) # <<<<<<<<<<<<<< @@ -3458,7 +3449,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { * return _read_map(fp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_list(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_list(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3466,7 +3457,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":522 + /* "hadoopy/_typedbytes.pyx":498 * elif type_code == 9: * return _read_list(fp) * elif type_code == 10: # <<<<<<<<<<<<<< @@ -3476,7 +3467,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { __pyx_t_1 = (__pyx_v_type_code == 10); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":523 + /* "hadoopy/_typedbytes.pyx":499 * return _read_list(fp) * elif type_code == 10: * return _read_map(fp) # <<<<<<<<<<<<<< @@ -3484,7 +3475,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { * return _read_pickle(fp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_map(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_map(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3492,7 +3483,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":524 + /* "hadoopy/_typedbytes.pyx":500 * elif type_code == 10: * return _read_map(fp) * elif type_code == 100: # <<<<<<<<<<<<<< @@ -3502,7 +3493,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { __pyx_t_1 = (__pyx_v_type_code == 100); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":525 + /* "hadoopy/_typedbytes.pyx":501 * return _read_map(fp) * elif type_code == 100: * return _read_pickle(fp) # <<<<<<<<<<<<<< @@ -3510,7 +3501,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { * raise StopIteration */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_pickle(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__read_pickle(__pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3518,7 +3509,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":526 + /* "hadoopy/_typedbytes.pyx":502 * elif type_code == 100: * return _read_pickle(fp) * elif type_code == 255: # <<<<<<<<<<<<<< @@ -3528,7 +3519,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { __pyx_t_1 = (__pyx_v_type_code == 255); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":527 + /* "hadoopy/_typedbytes.pyx":503 * return _read_pickle(fp) * elif type_code == 255: * raise StopIteration # <<<<<<<<<<<<<< @@ -3536,11 +3527,11 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { * raise StopIteration */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":528 + /* "hadoopy/_typedbytes.pyx":504 * elif type_code == 255: * raise StopIteration * elif type_code < 0: # <<<<<<<<<<<<<< @@ -3550,7 +3541,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { __pyx_t_1 = (__pyx_v_type_code < 0); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":529 + /* "hadoopy/_typedbytes.pyx":505 * raise StopIteration * elif type_code < 0: * raise StopIteration # <<<<<<<<<<<<<< @@ -3558,34 +3549,34 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { * raise IndexError('Bad index %d ' % type_code) */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } /*else*/ { - /* "hadoopy/_typedbytes.pyx":531 + /* "hadoopy/_typedbytes.pyx":507 * raise StopIteration * else: * raise IndexError('Bad index %d ' % type_code) # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_type_code); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_type_code); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; @@ -3602,7 +3593,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes__read_tb_code(void *__pyx_v_fp) { return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":534 +/* "hadoopy/_typedbytes.pyx":510 * * * cdef __read_key_value_tb(void *fp): # <<<<<<<<<<<<<< @@ -3619,33 +3610,33 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes___read_key_value_tb(void *__pyx_v int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__read_key_value_tb"); + __Pyx_RefNannySetupContext("__read_key_value_tb", 0); - /* "hadoopy/_typedbytes.pyx":535 + /* "hadoopy/_typedbytes.pyx":511 * * cdef __read_key_value_tb(void *fp): * k = _read_tb_code(fp) # <<<<<<<<<<<<<< * v = _read_tb_code(fp) * return k, v */ - __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__read_tb_code(__pyx_v_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__read_tb_code(__pyx_v_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_k = __pyx_t_1; __pyx_t_1 = 0; - /* "hadoopy/_typedbytes.pyx":536 + /* "hadoopy/_typedbytes.pyx":512 * cdef __read_key_value_tb(void *fp): * k = _read_tb_code(fp) * v = _read_tb_code(fp) # <<<<<<<<<<<<<< * return k, v * */ - __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__read_tb_code(__pyx_v_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes__read_tb_code(__pyx_v_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_v = __pyx_t_1; __pyx_t_1 = 0; - /* "hadoopy/_typedbytes.pyx":537 + /* "hadoopy/_typedbytes.pyx":513 * k = _read_tb_code(fp) * v = _read_tb_code(fp) * return k, v # <<<<<<<<<<<<<< @@ -3653,8 +3644,8 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes___read_key_value_tb(void *__pyx_v * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); @@ -3679,7 +3670,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes___read_key_value_tb(void *__pyx_v return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":540 +/* "hadoopy/_typedbytes.pyx":516 * * * cdef __write_key_value_tb(void *fp, kv): # <<<<<<<<<<<<<< @@ -3699,9 +3690,9 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes___write_key_value_tb(void *__pyx_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__write_key_value_tb"); + __Pyx_RefNannySetupContext("__write_key_value_tb", 0); - /* "hadoopy/_typedbytes.pyx":541 + /* "hadoopy/_typedbytes.pyx":517 * * cdef __write_key_value_tb(void *fp, kv): * k, v = kv # <<<<<<<<<<<<<< @@ -3714,7 +3705,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes___write_key_value_tb(void *__pyx_ if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); @@ -3722,7 +3713,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes___write_key_value_tb(void *__pyx_ if (unlikely(PyList_GET_SIZE(sequence) != 2)) { if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); @@ -3731,21 +3722,21 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes___write_key_value_tb(void *__pyx_ __Pyx_INCREF(__pyx_t_2); } else { Py_ssize_t index = -1; - __pyx_t_3 = PyObject_GetIter(__pyx_v_kv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetIter(__pyx_v_kv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_k = __pyx_t_1; @@ -3753,25 +3744,25 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes___write_key_value_tb(void *__pyx_ __pyx_v_v = __pyx_t_2; __pyx_t_2 = 0; - /* "hadoopy/_typedbytes.pyx":542 + /* "hadoopy/_typedbytes.pyx":518 * cdef __write_key_value_tb(void *fp, kv): * k, v = kv * _write_tb_code(fp, k) # <<<<<<<<<<<<<< * _write_tb_code(fp, v) * */ - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__write_tb_code(__pyx_v_fp, __pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__write_tb_code(__pyx_v_fp, __pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "hadoopy/_typedbytes.pyx":543 + /* "hadoopy/_typedbytes.pyx":519 * k, v = kv * _write_tb_code(fp, k) * _write_tb_code(fp, v) # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__write_tb_code(__pyx_v_fp, __pyx_v_v); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes__write_tb_code(__pyx_v_fp, __pyx_v_v); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3791,7 +3782,20 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes___write_key_value_tb(void *__pyx_ return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":546 +/* Python wrapper */ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_1read_tb(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_19_hadoopy_typedbytes_1read_tb = {__Pyx_NAMESTR("read_tb"), (PyCFunction)__pyx_pw_19_hadoopy_typedbytes_1read_tb, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_19_hadoopy_typedbytes_1read_tb(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_tb (wrapper)", 0); + __pyx_self = __pyx_self; + __pyx_r = __pyx_pf_19_hadoopy_typedbytes_read_tb(__pyx_self); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_typedbytes.pyx":522 * * * def read_tb(): # <<<<<<<<<<<<<< @@ -3799,19 +3803,16 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes___write_key_value_tb(void *__pyx_ * */ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_read_tb(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyMethodDef __pyx_mdef_19_hadoopy_typedbytes_read_tb = {__Pyx_NAMESTR("read_tb"), (PyCFunction)__pyx_pf_19_hadoopy_typedbytes_read_tb, METH_NOARGS, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pf_19_hadoopy_typedbytes_read_tb(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_19_hadoopy_typedbytes_read_tb(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_tb"); - __pyx_self = __pyx_self; + __Pyx_RefNannySetupContext("read_tb", 0); - /* "hadoopy/_typedbytes.pyx":547 + /* "hadoopy/_typedbytes.pyx":523 * * def read_tb(): * return __read_key_value_tb(stdin) # <<<<<<<<<<<<<< @@ -3819,7 +3820,7 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_read_tb(PyObject *__pyx_self, CY * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes___read_key_value_tb(stdin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes___read_key_value_tb(stdin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3837,7 +3838,20 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_read_tb(PyObject *__pyx_self, CY return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":550 +/* Python wrapper */ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_3write_tb(PyObject *__pyx_self, PyObject *__pyx_v_kv); /*proto*/ +static PyMethodDef __pyx_mdef_19_hadoopy_typedbytes_3write_tb = {__Pyx_NAMESTR("write_tb"), (PyCFunction)__pyx_pw_19_hadoopy_typedbytes_3write_tb, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_19_hadoopy_typedbytes_3write_tb(PyObject *__pyx_self, PyObject *__pyx_v_kv) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("write_tb (wrapper)", 0); + __pyx_self = __pyx_self; + __pyx_r = __pyx_pf_19_hadoopy_typedbytes_2write_tb(__pyx_self, ((PyObject *)__pyx_v_kv)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_typedbytes.pyx":526 * * * def write_tb(kv): # <<<<<<<<<<<<<< @@ -3845,26 +3859,23 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_read_tb(PyObject *__pyx_self, CY * */ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_1write_tb(PyObject *__pyx_self, PyObject *__pyx_v_kv); /*proto*/ -static PyMethodDef __pyx_mdef_19_hadoopy_typedbytes_1write_tb = {__Pyx_NAMESTR("write_tb"), (PyCFunction)__pyx_pf_19_hadoopy_typedbytes_1write_tb, METH_O, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pf_19_hadoopy_typedbytes_1write_tb(PyObject *__pyx_self, PyObject *__pyx_v_kv) { +static PyObject *__pyx_pf_19_hadoopy_typedbytes_2write_tb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_kv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("write_tb"); - __pyx_self = __pyx_self; + __Pyx_RefNannySetupContext("write_tb", 0); - /* "hadoopy/_typedbytes.pyx":551 + /* "hadoopy/_typedbytes.pyx":527 * * def write_tb(kv): * __write_key_value_tb(stdout, kv) # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes___write_key_value_tb(stdout, __pyx_v_kv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_19_hadoopy_typedbytes___write_key_value_tb(stdout, __pyx_v_kv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3880,43 +3891,28 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_1write_tb(PyObject *__pyx_self, return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":568 - * cdef object file_method - * cdef int flush_writes - * def __init__(self, fn=None, mode=None, read_fd=None, write_fd=None, flush_writes=False): # <<<<<<<<<<<<<< - * self.flush_writes = int(flush_writes) - * cdef char *fnc - */ - -static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +/* Python wrapper */ +static int __pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fn = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_read_fd = 0; PyObject *__pyx_v_write_fd = 0; PyObject *__pyx_v_flush_writes = 0; - char *__pyx_v_fnc; - char *__pyx_v_modec; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fn,&__pyx_n_s__mode,&__pyx_n_s__read_fd,&__pyx_n_s__write_fd,&__pyx_n_s__flush_writes,0}; int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - void *__pyx_t_8; - int __pyx_t_9; - int __pyx_t_10; - void *__pyx_t_11; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fn,&__pyx_n_s__mode,&__pyx_n_s__read_fd,&__pyx_n_s__write_fd,&__pyx_n_s__flush_writes,0}; - __Pyx_RefNannySetupContext("__init__"); + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { PyObject* values[5] = {0,0,0,0,0}; + + /* "hadoopy/_typedbytes.pyx":544 + * cdef object file_method + * cdef int flush_writes + * def __init__(self, fn=None, mode=None, read_fd=None, write_fd=None, flush_writes=False): # <<<<<<<<<<<<<< + * self.flush_writes = int(flush_writes) + * cdef char *fnc + */ values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); @@ -3924,7 +3920,8 @@ static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__ values[4] = __pyx_k_4; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; - switch (PyTuple_GET_SIZE(__pyx_args)) { + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -3934,7 +3931,7 @@ static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__ default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); - switch (PyTuple_GET_SIZE(__pyx_args)) { + switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fn); @@ -3962,7 +3959,7 @@ static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3983,50 +3980,75 @@ static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_hadoopy_typedbytes.TypedBytesFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self), __pyx_v_fn, __pyx_v_mode, __pyx_v_read_fd, __pyx_v_write_fd, __pyx_v_flush_writes); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self, PyObject *__pyx_v_fn, PyObject *__pyx_v_mode, PyObject *__pyx_v_read_fd, PyObject *__pyx_v_write_fd, PyObject *__pyx_v_flush_writes) { + char *__pyx_v_fnc; + char *__pyx_v_modec; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + void *__pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + void *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_mode); - /* "hadoopy/_typedbytes.pyx":569 + /* "hadoopy/_typedbytes.pyx":545 * cdef int flush_writes * def __init__(self, fn=None, mode=None, read_fd=None, write_fd=None, flush_writes=False): * self.flush_writes = int(flush_writes) # <<<<<<<<<<<<<< * cdef char *fnc * cdef char *modec */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_flush_writes); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_flush_writes); __Pyx_GIVEREF(__pyx_v_flush_writes); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - ((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->flush_writes = __pyx_t_3; + __pyx_v_self->flush_writes = __pyx_t_3; - /* "hadoopy/_typedbytes.pyx":572 + /* "hadoopy/_typedbytes.pyx":548 * cdef char *fnc * cdef char *modec * self._repr = "TypedBytesFile(%s, %s, %s, %s)" % (repr(fn), repr(mode), repr(read_fd), repr(write_fd)) # <<<<<<<<<<<<<< * if fn: * self.file_method = 'fn' */ - __pyx_t_2 = PyObject_Repr(__pyx_v_fn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Repr(__pyx_v_fn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_Repr(__pyx_v_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Repr(__pyx_v_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_Repr(__pyx_v_read_fd); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Repr(__pyx_v_read_fd); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_Repr(__pyx_v_write_fd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Repr(__pyx_v_write_fd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); @@ -4039,26 +4061,26 @@ static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__ __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); - __Pyx_GOTREF(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_repr); - __Pyx_DECREF(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_repr); - ((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_repr = ((PyObject *)__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->_repr); + __Pyx_DECREF(__pyx_v_self->_repr); + __pyx_v_self->_repr = ((PyObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "hadoopy/_typedbytes.pyx":573 + /* "hadoopy/_typedbytes.pyx":549 * cdef char *modec * self._repr = "TypedBytesFile(%s, %s, %s, %s)" % (repr(fn), repr(mode), repr(read_fd), repr(write_fd)) * if fn: # <<<<<<<<<<<<<< * self.file_method = 'fn' * if mode == None: */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_fn); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_fn); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_7) { - /* "hadoopy/_typedbytes.pyx":574 + /* "hadoopy/_typedbytes.pyx":550 * self._repr = "TypedBytesFile(%s, %s, %s, %s)" % (repr(fn), repr(mode), repr(read_fd), repr(write_fd)) * if fn: * self.file_method = 'fn' # <<<<<<<<<<<<<< @@ -4067,24 +4089,24 @@ static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__ */ __Pyx_INCREF(((PyObject *)__pyx_n_s__fn)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fn)); - __Pyx_GOTREF(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->file_method); - __Pyx_DECREF(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->file_method); - ((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->file_method = ((PyObject *)__pyx_n_s__fn); + __Pyx_GOTREF(__pyx_v_self->file_method); + __Pyx_DECREF(__pyx_v_self->file_method); + __pyx_v_self->file_method = ((PyObject *)__pyx_n_s__fn); - /* "hadoopy/_typedbytes.pyx":575 + /* "hadoopy/_typedbytes.pyx":551 * if fn: * self.file_method = 'fn' * if mode == None: # <<<<<<<<<<<<<< * mode = 'r' * fnc = PyString_AsString(fn) */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_mode, Py_None, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_mode, Py_None, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_7) { - /* "hadoopy/_typedbytes.pyx":576 + /* "hadoopy/_typedbytes.pyx":552 * self.file_method = 'fn' * if mode == None: * mode = 'r' # <<<<<<<<<<<<<< @@ -4094,11 +4116,11 @@ static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__ __Pyx_INCREF(((PyObject *)__pyx_n_s__r)); __Pyx_DECREF(__pyx_v_mode); __pyx_v_mode = ((PyObject *)__pyx_n_s__r); - goto __pyx_L7; + goto __pyx_L4; } - __pyx_L7:; + __pyx_L4:; - /* "hadoopy/_typedbytes.pyx":577 + /* "hadoopy/_typedbytes.pyx":553 * if mode == None: * mode = 'r' * fnc = PyString_AsString(fn) # <<<<<<<<<<<<<< @@ -4107,7 +4129,7 @@ static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__ */ __pyx_v_fnc = PyString_AsString(__pyx_v_fn); - /* "hadoopy/_typedbytes.pyx":578 + /* "hadoopy/_typedbytes.pyx":554 * mode = 'r' * fnc = PyString_AsString(fn) * modec = PyString_AsString(mode) # <<<<<<<<<<<<<< @@ -4116,7 +4138,7 @@ static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__ */ __pyx_v_modec = PyString_AsString(__pyx_v_mode); - /* "hadoopy/_typedbytes.pyx":579 + /* "hadoopy/_typedbytes.pyx":555 * fnc = PyString_AsString(fn) * modec = PyString_AsString(mode) * self._write_ptr = self._read_ptr = fopen(fnc, modec) # <<<<<<<<<<<<<< @@ -4124,60 +4146,60 @@ static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__ * raise IOError('Cannot open file [%s]' % fn) */ __pyx_t_8 = fopen(__pyx_v_fnc, __pyx_v_modec); - ((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_write_ptr = __pyx_t_8; - ((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_read_ptr = __pyx_t_8; + __pyx_v_self->_write_ptr = __pyx_t_8; + __pyx_v_self->_read_ptr = __pyx_t_8; - /* "hadoopy/_typedbytes.pyx":580 + /* "hadoopy/_typedbytes.pyx":556 * modec = PyString_AsString(mode) * self._write_ptr = self._read_ptr = fopen(fnc, modec) * if self._write_ptr == NULL: # <<<<<<<<<<<<<< * raise IOError('Cannot open file [%s]' % fn) * elif read_fd != None or write_fd != None: */ - __pyx_t_7 = (((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_write_ptr == NULL); + __pyx_t_7 = (__pyx_v_self->_write_ptr == NULL); if (__pyx_t_7) { - /* "hadoopy/_typedbytes.pyx":581 + /* "hadoopy/_typedbytes.pyx":557 * self._write_ptr = self._read_ptr = fopen(fnc, modec) * if self._write_ptr == NULL: * raise IOError('Cannot open file [%s]' % fn) # <<<<<<<<<<<<<< * elif read_fd != None or write_fd != None: * self.file_method = 'readwritefds' */ - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_v_fn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_v_fn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5)); __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; } - __pyx_L8:; - goto __pyx_L6; + __pyx_L5:; + goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":582 + /* "hadoopy/_typedbytes.pyx":558 * if self._write_ptr == NULL: * raise IOError('Cannot open file [%s]' % fn) * elif read_fd != None or write_fd != None: # <<<<<<<<<<<<<< * self.file_method = 'readwritefds' * self._read_ptr = fdopen(read_fd, 'r') if read_fd != None else 0 */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_read_fd, Py_None, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_read_fd, Py_None, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_7) { - __pyx_t_5 = PyObject_RichCompare(__pyx_v_write_fd, Py_None, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_write_fd, Py_None, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __pyx_t_9; } else { @@ -4185,7 +4207,7 @@ static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__ } if (__pyx_t_10) { - /* "hadoopy/_typedbytes.pyx":583 + /* "hadoopy/_typedbytes.pyx":559 * raise IOError('Cannot open file [%s]' % fn) * elif read_fd != None or write_fd != None: * self.file_method = 'readwritefds' # <<<<<<<<<<<<<< @@ -4194,52 +4216,52 @@ static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__ */ __Pyx_INCREF(((PyObject *)__pyx_n_s__readwritefds)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__readwritefds)); - __Pyx_GOTREF(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->file_method); - __Pyx_DECREF(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->file_method); - ((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->file_method = ((PyObject *)__pyx_n_s__readwritefds); + __Pyx_GOTREF(__pyx_v_self->file_method); + __Pyx_DECREF(__pyx_v_self->file_method); + __pyx_v_self->file_method = ((PyObject *)__pyx_n_s__readwritefds); - /* "hadoopy/_typedbytes.pyx":584 + /* "hadoopy/_typedbytes.pyx":560 * elif read_fd != None or write_fd != None: * self.file_method = 'readwritefds' * self._read_ptr = fdopen(read_fd, 'r') if read_fd != None else 0 # <<<<<<<<<<<<<< * self._write_ptr = fdopen(write_fd, 'w') if write_fd != None else 0 * else: */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_read_fd, Py_None, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_read_fd, Py_None, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_10) { - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_read_fd); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_read_fd); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = fdopen(__pyx_t_3, __pyx_k__r); } else { __pyx_t_11 = ((void *)0); } - ((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_read_ptr = __pyx_t_11; + __pyx_v_self->_read_ptr = __pyx_t_11; - /* "hadoopy/_typedbytes.pyx":585 + /* "hadoopy/_typedbytes.pyx":561 * self.file_method = 'readwritefds' * self._read_ptr = fdopen(read_fd, 'r') if read_fd != None else 0 * self._write_ptr = fdopen(write_fd, 'w') if write_fd != None else 0 # <<<<<<<<<<<<<< * else: * self.file_method = 'stdinout' */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_write_fd, Py_None, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_write_fd, Py_None, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_10) { - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_write_fd); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_write_fd); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = fdopen(__pyx_t_3, __pyx_k__w); } else { __pyx_t_11 = ((void *)0); } - ((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_write_ptr = __pyx_t_11; - goto __pyx_L6; + __pyx_v_self->_write_ptr = __pyx_t_11; + goto __pyx_L3; } /*else*/ { - /* "hadoopy/_typedbytes.pyx":587 + /* "hadoopy/_typedbytes.pyx":563 * self._write_ptr = fdopen(write_fd, 'w') if write_fd != None else 0 * else: * self.file_method = 'stdinout' # <<<<<<<<<<<<<< @@ -4248,29 +4270,29 @@ static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__ */ __Pyx_INCREF(((PyObject *)__pyx_n_s__stdinout)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__stdinout)); - __Pyx_GOTREF(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->file_method); - __Pyx_DECREF(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->file_method); - ((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->file_method = ((PyObject *)__pyx_n_s__stdinout); + __Pyx_GOTREF(__pyx_v_self->file_method); + __Pyx_DECREF(__pyx_v_self->file_method); + __pyx_v_self->file_method = ((PyObject *)__pyx_n_s__stdinout); - /* "hadoopy/_typedbytes.pyx":588 + /* "hadoopy/_typedbytes.pyx":564 * else: * self.file_method = 'stdinout' * self._write_ptr = stdout # <<<<<<<<<<<<<< * self._read_ptr = stdin * */ - ((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_write_ptr = stdout; + __pyx_v_self->_write_ptr = stdout; - /* "hadoopy/_typedbytes.pyx":589 + /* "hadoopy/_typedbytes.pyx":565 * self.file_method = 'stdinout' * self._write_ptr = stdout * self._read_ptr = stdin # <<<<<<<<<<<<<< * * cdef _close(self): */ - ((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_read_ptr = stdin; + __pyx_v_self->_read_ptr = stdin; } - __pyx_L6:; + __pyx_L3:; __pyx_r = 0; goto __pyx_L0; @@ -4288,7 +4310,7 @@ static int __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__(PyObject *__ return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":591 +/* "hadoopy/_typedbytes.pyx":567 * self._read_ptr = stdin * * cdef _close(self): # <<<<<<<<<<<<<< @@ -4304,30 +4326,30 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile__close(struct __ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_close"); + __Pyx_RefNannySetupContext("_close", 0); - /* "hadoopy/_typedbytes.pyx":592 + /* "hadoopy/_typedbytes.pyx":568 * * cdef _close(self): * self.flush() # <<<<<<<<<<<<<< * if self.file_method == 'readwritefds': * if self._write_ptr: */ - __pyx_t_1 = ((struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self->__pyx_vtab)->flush(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self->__pyx_vtab)->flush(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "hadoopy/_typedbytes.pyx":593 + /* "hadoopy/_typedbytes.pyx":569 * cdef _close(self): * self.flush() * if self.file_method == 'readwritefds': # <<<<<<<<<<<<<< * if self._write_ptr: * fclose(self._write_ptr) */ - __pyx_t_2 = __Pyx_PyString_Equals(__pyx_v_self->file_method, ((PyObject *)__pyx_n_s__readwritefds), Py_EQ); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyString_Equals(__pyx_v_self->file_method, ((PyObject *)__pyx_n_s__readwritefds), Py_EQ); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "hadoopy/_typedbytes.pyx":594 + /* "hadoopy/_typedbytes.pyx":570 * self.flush() * if self.file_method == 'readwritefds': * if self._write_ptr: # <<<<<<<<<<<<<< @@ -4337,7 +4359,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile__close(struct __ __pyx_t_2 = (__pyx_v_self->_write_ptr != 0); if (__pyx_t_2) { - /* "hadoopy/_typedbytes.pyx":595 + /* "hadoopy/_typedbytes.pyx":571 * if self.file_method == 'readwritefds': * if self._write_ptr: * fclose(self._write_ptr) # <<<<<<<<<<<<<< @@ -4349,7 +4371,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile__close(struct __ } __pyx_L4:; - /* "hadoopy/_typedbytes.pyx":596 + /* "hadoopy/_typedbytes.pyx":572 * if self._write_ptr: * fclose(self._write_ptr) * if self._read_ptr: # <<<<<<<<<<<<<< @@ -4359,7 +4381,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile__close(struct __ __pyx_t_2 = (__pyx_v_self->_read_ptr != 0); if (__pyx_t_2) { - /* "hadoopy/_typedbytes.pyx":597 + /* "hadoopy/_typedbytes.pyx":573 * fclose(self._write_ptr) * if self._read_ptr: * fclose(self._read_ptr) # <<<<<<<<<<<<<< @@ -4373,17 +4395,17 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile__close(struct __ goto __pyx_L3; } - /* "hadoopy/_typedbytes.pyx":598 + /* "hadoopy/_typedbytes.pyx":574 * if self._read_ptr: * fclose(self._read_ptr) * elif self.file_method == 'stdinout': # <<<<<<<<<<<<<< * fclose(self._write_ptr) * self._write_ptr = NULL */ - __pyx_t_2 = __Pyx_PyString_Equals(__pyx_v_self->file_method, ((PyObject *)__pyx_n_s__stdinout), Py_EQ); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyString_Equals(__pyx_v_self->file_method, ((PyObject *)__pyx_n_s__stdinout), Py_EQ); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "hadoopy/_typedbytes.pyx":599 + /* "hadoopy/_typedbytes.pyx":575 * fclose(self._read_ptr) * elif self.file_method == 'stdinout': * fclose(self._write_ptr) # <<<<<<<<<<<<<< @@ -4395,7 +4417,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile__close(struct __ } __pyx_L3:; - /* "hadoopy/_typedbytes.pyx":600 + /* "hadoopy/_typedbytes.pyx":576 * elif self.file_method == 'stdinout': * fclose(self._write_ptr) * self._write_ptr = NULL # <<<<<<<<<<<<<< @@ -4404,7 +4426,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile__close(struct __ */ __pyx_v_self->_write_ptr = NULL; - /* "hadoopy/_typedbytes.pyx":601 + /* "hadoopy/_typedbytes.pyx":577 * fclose(self._write_ptr) * self._write_ptr = NULL * self._read_ptr = NULL # <<<<<<<<<<<<<< @@ -4425,7 +4447,18 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile__close(struct __ return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":603 +/* Python wrapper */ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_3__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_3__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_2__repr__(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_typedbytes.pyx":579 * self._read_ptr = NULL * * def __repr__(self): # <<<<<<<<<<<<<< @@ -4433,13 +4466,12 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile__close(struct __ * */ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_1__repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_1__repr__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_2__repr__(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__repr__"); + __Pyx_RefNannySetupContext("__repr__", 0); - /* "hadoopy/_typedbytes.pyx":604 + /* "hadoopy/_typedbytes.pyx":580 * * def __repr__(self): * return self._repr # <<<<<<<<<<<<<< @@ -4447,8 +4479,8 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_1__repr__(PyObj * def __enter__(self): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_repr); - __pyx_r = ((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_repr; + __Pyx_INCREF(__pyx_v_self->_repr); + __pyx_r = __pyx_v_self->_repr; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4458,7 +4490,18 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_1__repr__(PyObj return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":606 +/* Python wrapper */ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_5__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_5__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); + __pyx_r = __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_4__enter__(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_typedbytes.pyx":582 * return self._repr * * def __enter__(self): # <<<<<<<<<<<<<< @@ -4466,13 +4509,12 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_1__repr__(PyObj * */ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_2__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_2__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_4__enter__(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__enter__"); + __Pyx_RefNannySetupContext("__enter__", 0); - /* "hadoopy/_typedbytes.pyx":607 + /* "hadoopy/_typedbytes.pyx":583 * * def __enter__(self): * return self # <<<<<<<<<<<<<< @@ -4480,8 +4522,8 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_2__enter__(PyOb * def __exit__(self, type, value, traceback): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self); - __pyx_r = __pyx_v_self; + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4491,32 +4533,22 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_2__enter__(PyOb return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":609 - * return self - * - * def __exit__(self, type, value, traceback): # <<<<<<<<<<<<<< - * self._close() - * - */ - -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_3__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_3__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_type = 0; - PyObject *__pyx_v_value = 0; - PyObject *__pyx_v_traceback = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +/* Python wrapper */ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_type = 0; + CYTHON_UNUSED PyObject *__pyx_v_value = 0; + CYTHON_UNUSED PyObject *__pyx_v_traceback = 0; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__type,&__pyx_n_s__value,&__pyx_n_s__traceback,0}; - __Pyx_RefNannySetupContext("__exit__"); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); { PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; - switch (PyTuple_GET_SIZE(__pyx_args)) { + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -4524,7 +4556,7 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_3__exit__(PyObj default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); - switch (PyTuple_GET_SIZE(__pyx_args)) { + switch (pos_args) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type); if (likely(values[0])) kw_args--; @@ -4533,17 +4565,17 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_3__exit__(PyObj values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__traceback); if (likely(values[2])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -4558,21 +4590,42 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_3__exit__(PyObj } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_hadoopy_typedbytes.TypedBytesFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_6__exit__(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self), __pyx_v_type, __pyx_v_value, __pyx_v_traceback); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_typedbytes.pyx":585 + * return self + * + * def __exit__(self, type, value, traceback): # <<<<<<<<<<<<<< + * self._close() + * + */ + +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_6__exit__(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__exit__", 0); - /* "hadoopy/_typedbytes.pyx":610 + /* "hadoopy/_typedbytes.pyx":586 * * def __exit__(self, type, value, traceback): * self._close() # <<<<<<<<<<<<<< * * def __del__(self): */ - __pyx_t_1 = ((struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *)((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->__pyx_vtab)->_close(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self->__pyx_vtab)->_close(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4588,7 +4641,18 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_3__exit__(PyObj return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":612 +/* Python wrapper */ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_9__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_9__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_8__del__(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_typedbytes.pyx":588 * self._close() * * def __del__(self): # <<<<<<<<<<<<<< @@ -4596,24 +4660,23 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_3__exit__(PyObj * */ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_4__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_4__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_8__del__(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__del__"); + __Pyx_RefNannySetupContext("__del__", 0); - /* "hadoopy/_typedbytes.pyx":613 + /* "hadoopy/_typedbytes.pyx":589 * * def __del__(self): * self._close() # <<<<<<<<<<<<<< * * def __iter__(self): */ - __pyx_t_1 = ((struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *)((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->__pyx_vtab)->_close(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self->__pyx_vtab)->_close(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4629,7 +4692,18 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_4__del__(PyObje return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":615 +/* Python wrapper */ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_11__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_11__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_10__iter__(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_typedbytes.pyx":591 * self._close() * * def __iter__(self): # <<<<<<<<<<<<<< @@ -4637,13 +4711,12 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_4__del__(PyObje * */ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_5__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_5__iter__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_10__iter__(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__"); + __Pyx_RefNannySetupContext("__iter__", 0); - /* "hadoopy/_typedbytes.pyx":616 + /* "hadoopy/_typedbytes.pyx":592 * * def __iter__(self): * return self # <<<<<<<<<<<<<< @@ -4651,8 +4724,8 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_5__iter__(PyObj * def __next__(self): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self); - __pyx_r = __pyx_v_self; + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4662,7 +4735,18 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_5__iter__(PyObj return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":618 +/* Python wrapper */ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_13__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_13__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_12__next__(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_typedbytes.pyx":594 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -4670,8 +4754,7 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_5__iter__(PyObj * raise ValueError("Read pointer not set!") */ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_6__next__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_6__next__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_12__next__(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -4679,35 +4762,35 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_6__next__(PyObj int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__next__"); + __Pyx_RefNannySetupContext("__next__", 0); - /* "hadoopy/_typedbytes.pyx":619 + /* "hadoopy/_typedbytes.pyx":595 * * def __next__(self): * if self._read_ptr == 0: # <<<<<<<<<<<<<< * raise ValueError("Read pointer not set!") * return __read_key_value_tb(self._read_ptr) */ - __pyx_t_1 = (((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_read_ptr == ((void *)0)); + __pyx_t_1 = (__pyx_v_self->_read_ptr == ((void *)0)); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":620 + /* "hadoopy/_typedbytes.pyx":596 * def __next__(self): * if self._read_ptr == 0: * raise ValueError("Read pointer not set!") # <<<<<<<<<<<<<< * return __read_key_value_tb(self._read_ptr) * */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; } - __pyx_L5:; + __pyx_L3:; - /* "hadoopy/_typedbytes.pyx":621 + /* "hadoopy/_typedbytes.pyx":597 * if self._read_ptr == 0: * raise ValueError("Read pointer not set!") * return __read_key_value_tb(self._read_ptr) # <<<<<<<<<<<<<< @@ -4715,7 +4798,7 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_6__next__(PyObj * def write(self, kv): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes___read_key_value_tb(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_read_ptr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes___read_key_value_tb(__pyx_v_self->_read_ptr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -4733,7 +4816,18 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_6__next__(PyObj return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":623 +/* Python wrapper */ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_15write(PyObject *__pyx_v_self, PyObject *__pyx_v_kv); /*proto*/ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_15write(PyObject *__pyx_v_self, PyObject *__pyx_v_kv) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("write (wrapper)", 0); + __pyx_r = __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_14write(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self), ((PyObject *)__pyx_v_kv)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_typedbytes.pyx":599 * return __read_key_value_tb(self._read_ptr) * * def write(self, kv): # <<<<<<<<<<<<<< @@ -4741,8 +4835,7 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_6__next__(PyObj * raise ValueError("Write pointer not set!") */ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_7write(PyObject *__pyx_v_self, PyObject *__pyx_v_kv); /*proto*/ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_7write(PyObject *__pyx_v_self, PyObject *__pyx_v_kv) { +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_14write(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self, PyObject *__pyx_v_kv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -4750,67 +4843,67 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_7write(PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("write"); + __Pyx_RefNannySetupContext("write", 0); - /* "hadoopy/_typedbytes.pyx":624 + /* "hadoopy/_typedbytes.pyx":600 * * def write(self, kv): * if self._write_ptr == 0: # <<<<<<<<<<<<<< * raise ValueError("Write pointer not set!") * __write_key_value_tb(self._write_ptr, kv) */ - __pyx_t_1 = (((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_write_ptr == ((void *)0)); + __pyx_t_1 = (__pyx_v_self->_write_ptr == ((void *)0)); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":625 + /* "hadoopy/_typedbytes.pyx":601 * def write(self, kv): * if self._write_ptr == 0: * raise ValueError("Write pointer not set!") # <<<<<<<<<<<<<< * __write_key_value_tb(self._write_ptr, kv) * if self.flush_writes: */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; } - __pyx_L5:; + __pyx_L3:; - /* "hadoopy/_typedbytes.pyx":626 + /* "hadoopy/_typedbytes.pyx":602 * if self._write_ptr == 0: * raise ValueError("Write pointer not set!") * __write_key_value_tb(self._write_ptr, kv) # <<<<<<<<<<<<<< * if self.flush_writes: * self.flush() */ - __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes___write_key_value_tb(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_write_ptr, __pyx_v_kv); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_19_hadoopy_typedbytes___write_key_value_tb(__pyx_v_self->_write_ptr, __pyx_v_kv); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "hadoopy/_typedbytes.pyx":627 + /* "hadoopy/_typedbytes.pyx":603 * raise ValueError("Write pointer not set!") * __write_key_value_tb(self._write_ptr, kv) * if self.flush_writes: # <<<<<<<<<<<<<< * self.flush() * */ - if (((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->flush_writes) { + if (__pyx_v_self->flush_writes) { - /* "hadoopy/_typedbytes.pyx":628 + /* "hadoopy/_typedbytes.pyx":604 * __write_key_value_tb(self._write_ptr, kv) * if self.flush_writes: * self.flush() # <<<<<<<<<<<<<< * * def writes(self, kvs): */ - __pyx_t_2 = ((struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *)((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->__pyx_vtab)->flush(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self->__pyx_vtab)->flush(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L6; + goto __pyx_L4; } - __pyx_L6:; + __pyx_L4:; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -4824,7 +4917,18 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_7write(PyObject return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":630 +/* Python wrapper */ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_17writes(PyObject *__pyx_v_self, PyObject *__pyx_v_kvs); /*proto*/ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_17writes(PyObject *__pyx_v_self, PyObject *__pyx_v_kvs) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("writes (wrapper)", 0); + __pyx_r = __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_16writes(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self), ((PyObject *)__pyx_v_kvs)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_typedbytes.pyx":606 * self.flush() * * def writes(self, kvs): # <<<<<<<<<<<<<< @@ -4832,8 +4936,7 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_7write(PyObject * raise ValueError("Write pointer not set!") */ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_8writes(PyObject *__pyx_v_self, PyObject *__pyx_v_kvs); /*proto*/ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_8writes(PyObject *__pyx_v_self, PyObject *__pyx_v_kvs) { +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_16writes(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self, PyObject *__pyx_v_kvs) { PyObject *__pyx_v_kv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -4845,35 +4948,35 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_8writes(PyObjec int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("writes"); + __Pyx_RefNannySetupContext("writes", 0); - /* "hadoopy/_typedbytes.pyx":631 + /* "hadoopy/_typedbytes.pyx":607 * * def writes(self, kvs): * if self._write_ptr == 0: # <<<<<<<<<<<<<< * raise ValueError("Write pointer not set!") * for kv in kvs: */ - __pyx_t_1 = (((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_write_ptr == ((void *)0)); + __pyx_t_1 = (__pyx_v_self->_write_ptr == ((void *)0)); if (__pyx_t_1) { - /* "hadoopy/_typedbytes.pyx":632 + /* "hadoopy/_typedbytes.pyx":608 * def writes(self, kvs): * if self._write_ptr == 0: * raise ValueError("Write pointer not set!") # <<<<<<<<<<<<<< * for kv in kvs: * __write_key_value_tb(self._write_ptr, kv) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; } - __pyx_L5:; + __pyx_L3:; - /* "hadoopy/_typedbytes.pyx":633 + /* "hadoopy/_typedbytes.pyx":609 * if self._write_ptr == 0: * raise ValueError("Write pointer not set!") * for kv in kvs: # <<<<<<<<<<<<<< @@ -4884,15 +4987,15 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_8writes(PyObjec __pyx_t_2 = __pyx_v_kvs; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_kvs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_kvs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; } for (;;) { - if (PyList_CheckExact(__pyx_t_2)) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; - } else if (PyTuple_CheckExact(__pyx_t_2)) { + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; } else { @@ -4900,7 +5003,7 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_8writes(PyObjec if (unlikely(!__pyx_t_5)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -4910,41 +5013,41 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_8writes(PyObjec __pyx_v_kv = __pyx_t_5; __pyx_t_5 = 0; - /* "hadoopy/_typedbytes.pyx":634 + /* "hadoopy/_typedbytes.pyx":610 * raise ValueError("Write pointer not set!") * for kv in kvs: * __write_key_value_tb(self._write_ptr, kv) # <<<<<<<<<<<<<< * if self.flush_writes: * self.flush() */ - __pyx_t_5 = __pyx_f_19_hadoopy_typedbytes___write_key_value_tb(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->_write_ptr, __pyx_v_kv); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_f_19_hadoopy_typedbytes___write_key_value_tb(__pyx_v_self->_write_ptr, __pyx_v_kv); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "hadoopy/_typedbytes.pyx":635 + /* "hadoopy/_typedbytes.pyx":611 * for kv in kvs: * __write_key_value_tb(self._write_ptr, kv) * if self.flush_writes: # <<<<<<<<<<<<<< * self.flush() * */ - if (((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->flush_writes) { + if (__pyx_v_self->flush_writes) { - /* "hadoopy/_typedbytes.pyx":636 + /* "hadoopy/_typedbytes.pyx":612 * __write_key_value_tb(self._write_ptr, kv) * if self.flush_writes: * self.flush() # <<<<<<<<<<<<<< * * cpdef flush(self): */ - __pyx_t_2 = ((struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *)((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->__pyx_vtab)->flush(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self->__pyx_vtab)->flush(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L8; + goto __pyx_L6; } - __pyx_L8:; + __pyx_L6:; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -4960,7 +5063,7 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_8writes(PyObjec return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":638 +/* "hadoopy/_typedbytes.pyx":614 * self.flush() * * cpdef flush(self): # <<<<<<<<<<<<<< @@ -4968,7 +5071,7 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_8writes(PyObjec * fflush(self._write_ptr) */ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_9flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_19flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile_flush(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self, int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -4978,16 +5081,16 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile_flush(struct __p int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("flush"); + __Pyx_RefNannySetupContext("flush", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__flush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__flush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_9flush)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_19flush)) { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -4997,7 +5100,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile_flush(struct __p __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "hadoopy/_typedbytes.pyx":639 + /* "hadoopy/_typedbytes.pyx":615 * * cpdef flush(self): * if self._write_ptr: # <<<<<<<<<<<<<< @@ -5007,7 +5110,7 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile_flush(struct __p __pyx_t_3 = (__pyx_v_self->_write_ptr != 0); if (__pyx_t_3) { - /* "hadoopy/_typedbytes.pyx":640 + /* "hadoopy/_typedbytes.pyx":616 * cpdef flush(self): * if self._write_ptr: * fflush(self._write_ptr) # <<<<<<<<<<<<<< @@ -5032,7 +5135,18 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile_flush(struct __p return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":638 +/* Python wrapper */ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_19flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_19flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("flush (wrapper)", 0); + __pyx_r = __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_18flush(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_typedbytes.pyx":614 * self.flush() * * cpdef flush(self): # <<<<<<<<<<<<<< @@ -5040,17 +5154,16 @@ static PyObject *__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile_flush(struct __p * fflush(self._write_ptr) */ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_9flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_9flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_18flush(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("flush"); + __Pyx_RefNannySetupContext("flush", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *)((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->__pyx_vtab)->flush(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self->__pyx_vtab)->flush(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5068,29 +5181,39 @@ static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_9flush(PyObject return __pyx_r; } -/* "hadoopy/_typedbytes.pyx":642 +/* Python wrapper */ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_21close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_21close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("close (wrapper)", 0); + __pyx_r = __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_20close(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hadoopy/_typedbytes.pyx":618 * fflush(self._write_ptr) * * def close(self): # <<<<<<<<<<<<<< * self._close() */ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_10close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_10close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_20close(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("close"); + __Pyx_RefNannySetupContext("close", 0); - /* "hadoopy/_typedbytes.pyx":643 + /* "hadoopy/_typedbytes.pyx":619 * * def close(self): * self._close() # <<<<<<<<<<<<<< */ - __pyx_t_1 = ((struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *)((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)->__pyx_vtab)->_close(((struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_19_hadoopy_typedbytes_TypedBytesFile *)__pyx_v_self->__pyx_vtab)->_close(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5150,14 +5273,14 @@ static int __pyx_tp_clear_19_hadoopy_typedbytes_TypedBytesFile(PyObject *o) { } static PyMethodDef __pyx_methods_19_hadoopy_typedbytes_TypedBytesFile[] = { - {__Pyx_NAMESTR("__enter__"), (PyCFunction)__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_2__enter__, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("__exit__"), (PyCFunction)__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_3__exit__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("__del__"), (PyCFunction)__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_4__del__, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_6__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_7write, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("writes"), (PyCFunction)__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_8writes, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("flush"), (PyCFunction)__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_9flush, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_10close, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__enter__"), (PyCFunction)__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_5__enter__, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__exit__"), (PyCFunction)__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_7__exit__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__del__"), (PyCFunction)__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_9__del__, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_13__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_15write, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("writes"), (PyCFunction)__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_17writes, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("flush"), (PyCFunction)__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_19flush, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_21close, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -5273,7 +5396,7 @@ static PyTypeObject __pyx_type_19_hadoopy_typedbytes_TypedBytesFile = { #else 0, /*reserved*/ #endif - __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_1__repr__, /*tp_repr*/ + __pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_3__repr__, /*tp_repr*/ &__pyx_tp_as_number_TypedBytesFile, /*tp_as_number*/ &__pyx_tp_as_sequence_TypedBytesFile, /*tp_as_sequence*/ &__pyx_tp_as_mapping_TypedBytesFile, /*tp_as_mapping*/ @@ -5289,8 +5412,8 @@ static PyTypeObject __pyx_type_19_hadoopy_typedbytes_TypedBytesFile = { __pyx_tp_clear_19_hadoopy_typedbytes_TypedBytesFile, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_5__iter__, /*tp_iter*/ - __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile_6__next__, /*tp_iternext*/ + __pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_11__iter__, /*tp_iter*/ + __pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_13__next__, /*tp_iternext*/ __pyx_methods_19_hadoopy_typedbytes_TypedBytesFile, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ @@ -5299,7 +5422,7 @@ static PyTypeObject __pyx_type_19_hadoopy_typedbytes_TypedBytesFile = { 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_19_hadoopy_typedbytes_14TypedBytesFile___init__, /*tp_init*/ + __pyx_pw_19_hadoopy_typedbytes_14TypedBytesFile_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_19_hadoopy_typedbytes_TypedBytesFile, /*tp_new*/ 0, /*tp_free*/ @@ -5337,6 +5460,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, + {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0}, {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, @@ -5370,6 +5494,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s__flush_writes, __pyx_k__flush_writes, sizeof(__pyx_k__flush_writes), 0, 0, 1, 1}, {&__pyx_n_s__fn, __pyx_k__fn, sizeof(__pyx_k__fn), 0, 0, 1, 1}, {&__pyx_n_s__iteritems, __pyx_k__iteritems, sizeof(__pyx_k__iteritems), 0, 0, 1, 1}, + {&__pyx_n_s__kv, __pyx_k__kv, sizeof(__pyx_k__kv), 0, 0, 1, 1}, {&__pyx_n_s__loads, __pyx_k__loads, sizeof(__pyx_k__loads), 0, 0, 1, 1}, {&__pyx_n_s__mode, __pyx_k__mode, sizeof(__pyx_k__mode), 0, 0, 1, 1}, {&__pyx_n_s__pickle, __pyx_k__pickle, sizeof(__pyx_k__pickle), 0, 0, 1, 1}, @@ -5389,12 +5514,12 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_OverflowError = __Pyx_GetName(__pyx_b, __pyx_n_s__OverflowError); if (!__pyx_builtin_OverflowError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_n_s__IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_n_s__IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -5402,7 +5527,7 @@ static int __Pyx_InitCachedBuiltins(void) { static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "hadoopy/_typedbytes.pyx":299 * cdef char *bytes @@ -5412,53 +5537,77 @@ static int __Pyx_InitCachedConstants(void) { * _raw_write_int(fp, sz) */ __pyx_k_tuple_2 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_2)); + __Pyx_GOTREF(__pyx_k_tuple_2); __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_kp_s_1)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2)); - /* "hadoopy/_typedbytes.pyx":620 + /* "hadoopy/_typedbytes.pyx":596 * def __next__(self): * if self._read_ptr == 0: * raise ValueError("Read pointer not set!") # <<<<<<<<<<<<<< * return __read_key_value_tb(self._read_ptr) * */ - __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_8)); + __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_8); __Pyx_INCREF(((PyObject *)__pyx_kp_s_7)); PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_kp_s_7)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8)); - /* "hadoopy/_typedbytes.pyx":625 + /* "hadoopy/_typedbytes.pyx":601 * def write(self, kv): * if self._write_ptr == 0: * raise ValueError("Write pointer not set!") # <<<<<<<<<<<<<< * __write_key_value_tb(self._write_ptr, kv) * if self.flush_writes: */ - __pyx_k_tuple_10 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_10)); + __pyx_k_tuple_10 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_10); __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, ((PyObject *)__pyx_kp_s_9)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10)); - /* "hadoopy/_typedbytes.pyx":632 + /* "hadoopy/_typedbytes.pyx":608 * def writes(self, kvs): * if self._write_ptr == 0: * raise ValueError("Write pointer not set!") # <<<<<<<<<<<<<< * for kv in kvs: * __write_key_value_tb(self._write_ptr, kv) */ - __pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_11)); + __pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_11); __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_kp_s_9)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); + + /* "hadoopy/_typedbytes.pyx":522 + * + * + * def read_tb(): # <<<<<<<<<<<<<< + * return __read_key_value_tb(stdin) + * + */ + __pyx_k_codeobj_14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_15, __pyx_n_s__read_tb, 522, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "hadoopy/_typedbytes.pyx":526 + * + * + * def write_tb(kv): # <<<<<<<<<<<<<< + * __write_key_value_tb(stdout, kv) + * + */ + __pyx_k_tuple_16 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_16); + __Pyx_INCREF(((PyObject *)__pyx_n_s__kv)); + PyTuple_SET_ITEM(__pyx_k_tuple_16, 0, ((PyObject *)__pyx_n_s__kv)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s__kv)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16)); + __pyx_k_codeobj_17 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_15, __pyx_n_s__write_tb, 526, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -5508,12 +5657,18 @@ PyMODINIT_FUNC PyInit__hadoopy_typedbytes(void) Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__hadoopy_typedbytes(void)"); + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__hadoopy_typedbytes(void)", 0); if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #ifdef __pyx_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ @@ -5551,9 +5706,9 @@ PyMODINIT_FUNC PyInit__hadoopy_typedbytes(void) __pyx_vtabptr_19_hadoopy_typedbytes_TypedBytesFile = &__pyx_vtable_19_hadoopy_typedbytes_TypedBytesFile; __pyx_vtable_19_hadoopy_typedbytes_TypedBytesFile._close = (PyObject *(*)(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *))__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile__close; __pyx_vtable_19_hadoopy_typedbytes_TypedBytesFile.flush = (PyObject *(*)(struct __pyx_obj_19_hadoopy_typedbytes_TypedBytesFile *, int __pyx_skip_dispatch))__pyx_f_19_hadoopy_typedbytes_14TypedBytesFile_flush; - if (PyType_Ready(&__pyx_type_19_hadoopy_typedbytes_TypedBytesFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_19_hadoopy_typedbytes_TypedBytesFile.tp_dict, __pyx_vtabptr_19_hadoopy_typedbytes_TypedBytesFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "TypedBytesFile", (PyObject *)&__pyx_type_19_hadoopy_typedbytes_TypedBytesFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_19_hadoopy_typedbytes_TypedBytesFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_19_hadoopy_typedbytes_TypedBytesFile.tp_dict, __pyx_vtabptr_19_hadoopy_typedbytes_TypedBytesFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "TypedBytesFile", (PyObject *)&__pyx_type_19_hadoopy_typedbytes_TypedBytesFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_19_hadoopy_typedbytes_TypedBytesFile = &__pyx_type_19_hadoopy_typedbytes_TypedBytesFile; /*--- Type import code ---*/ /*--- Variable import code ---*/ @@ -5602,177 +5757,177 @@ PyMODINIT_FUNC PyInit__hadoopy_typedbytes(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pickle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "hadoopy/_typedbytes.pyx":452 + /* "hadoopy/_typedbytes.pyx":428 * # 1: _write_byte unused * # 5: _write_float unused * _out_types = {types.BooleanType: 2, # <<<<<<<<<<<<<< * types.IntType: 3, * types.LongType: 4, */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__BooleanType); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__BooleanType); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "hadoopy/_typedbytes.pyx":453 + /* "hadoopy/_typedbytes.pyx":429 * # 5: _write_float unused * _out_types = {types.BooleanType: 2, * types.IntType: 3, # <<<<<<<<<<<<<< * types.LongType: 4, * types.FloatType: 6, */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__IntType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__IntType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "hadoopy/_typedbytes.pyx":454 + /* "hadoopy/_typedbytes.pyx":430 * _out_types = {types.BooleanType: 2, * types.IntType: 3, * types.LongType: 4, # <<<<<<<<<<<<<< * types.FloatType: 6, * types.StringType: 0, */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__LongType); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__LongType); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "hadoopy/_typedbytes.pyx":455 + /* "hadoopy/_typedbytes.pyx":431 * types.IntType: 3, * types.LongType: 4, * types.FloatType: 6, # <<<<<<<<<<<<<< * types.StringType: 0, * types.UnicodeType: 7, */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__FloatType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__FloatType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "hadoopy/_typedbytes.pyx":456 + /* "hadoopy/_typedbytes.pyx":432 * types.LongType: 4, * types.FloatType: 6, * types.StringType: 0, # <<<<<<<<<<<<<< * types.UnicodeType: 7, * types.TupleType: 8, */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__StringType); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__StringType); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "hadoopy/_typedbytes.pyx":457 + /* "hadoopy/_typedbytes.pyx":433 * types.FloatType: 6, * types.StringType: 0, * types.UnicodeType: 7, # <<<<<<<<<<<<<< * types.TupleType: 8, * types.ListType: 9, */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__UnicodeType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__UnicodeType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "hadoopy/_typedbytes.pyx":458 + /* "hadoopy/_typedbytes.pyx":434 * types.StringType: 0, * types.UnicodeType: 7, * types.TupleType: 8, # <<<<<<<<<<<<<< * types.ListType: 9, * types.DictType: 10} */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__TupleType); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__TupleType); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_int_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_int_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "hadoopy/_typedbytes.pyx":459 + /* "hadoopy/_typedbytes.pyx":435 * types.UnicodeType: 7, * types.TupleType: 8, * types.ListType: 9, # <<<<<<<<<<<<<< * types.DictType: 10} * */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ListType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ListType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "hadoopy/_typedbytes.pyx":460 + /* "hadoopy/_typedbytes.pyx":436 * types.TupleType: 8, * types.ListType: 9, * types.DictType: 10} # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__DictType); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__DictType); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_int_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_int_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___out_types, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s___out_types, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "hadoopy/_typedbytes.pyx":546 + /* "hadoopy/_typedbytes.pyx":522 * * * def read_tb(): # <<<<<<<<<<<<<< * return __read_key_value_tb(stdin) * */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_19_hadoopy_typedbytes_read_tb, NULL, __pyx_n_s___hadoopy_typedbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_19_hadoopy_typedbytes_1read_tb, NULL, __pyx_n_s___hadoopy_typedbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__read_tb, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__read_tb, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "hadoopy/_typedbytes.pyx":550 + /* "hadoopy/_typedbytes.pyx":526 * * * def write_tb(kv): # <<<<<<<<<<<<<< * __write_key_value_tb(stdout, kv) * */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_19_hadoopy_typedbytes_1write_tb, NULL, __pyx_n_s___hadoopy_typedbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_19_hadoopy_typedbytes_3write_tb, NULL, __pyx_n_s___hadoopy_typedbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__write_tb, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__write_tb, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "hadoopy/_typedbytes.pyx":568 + /* "hadoopy/_typedbytes.pyx":544 * cdef object file_method * cdef int flush_writes * def __init__(self, fn=None, mode=None, read_fd=None, write_fd=None, flush_writes=False): # <<<<<<<<<<<<<< * self.flush_writes = int(flush_writes) * cdef char *fnc */ - __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_k_4 = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); @@ -5808,7 +5963,6 @@ PyMODINIT_FUNC PyInit__hadoopy_typedbytes(void) } /* Runtime support code */ - #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; @@ -5885,7 +6039,6 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) return -1; } - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %"PY_FORMAT_SIZE_T"d value%s to unpack", @@ -5914,9 +6067,9 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { } static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; @@ -5926,27 +6079,30 @@ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyOb Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif } - static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif } - #if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - /* cause is unused */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); Py_XINCREF(value); Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ if (tb == Py_None) { Py_DECREF(tb); tb = 0; @@ -5956,7 +6112,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject "raise: arg 3 must be a traceback or None"); goto raise_error; } - /* Next, replace a missing value with None */ if (value == NULL) { value = Py_None; Py_INCREF(value); @@ -5967,13 +6122,11 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject if (!PyType_Check(type)) #endif { - /* Raising an instance. The value should be a dummy. */ if (value != Py_None) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } - /* Normalize to raise , */ Py_DECREF(value); value = type; #if PY_VERSION_HEX < 0x02050000 @@ -5997,7 +6150,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } #endif } - __Pyx_ErrRestore(type, value, tb); return; raise_error: @@ -6006,9 +6158,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(tb); return; } - #else /* Python 3+ */ - static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { if (tb == Py_None) { tb = 0; @@ -6019,7 +6169,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } if (value == Py_None) value = 0; - if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, @@ -6033,7 +6182,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject "raise: exception class must be a subclass of BaseException"); goto bad; } - if (cause) { PyObject *fixed_cause; if (PyExceptionClass_Check(cause)) { @@ -6056,9 +6204,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyException_SetCause(value, fixed_cause); } - PyErr_SetObject(type, value); - if (tb) { PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; @@ -6068,7 +6214,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(tmp_tb); } } - bad: return; } @@ -6099,7 +6244,6 @@ static int __Pyx_ParseOptionalKeywords( Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; - while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; @@ -6109,7 +6253,7 @@ static int __Pyx_ParseOptionalKeywords( #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { + if (unlikely(!PyUnicode_Check(key))) { #endif goto invalid_keyword_type; } else { @@ -6125,7 +6269,6 @@ static int __Pyx_ParseOptionalKeywords( if (*name) { values[name-argnames] = value; } else { - /* unexpected keyword found */ for (name=argnames; name != first_kw_arg; name++) { if (**name == key) goto arg_passed_twice; #if PY_MAJOR_VERSION >= 3 @@ -6175,7 +6318,6 @@ static void __Pyx_RaiseArgtupleInvalid( { Py_ssize_t num_expected; const char *more_or_less; - if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; @@ -6201,7 +6343,6 @@ static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, Py_XINCREF(*value); Py_XINCREF(*tb); } - static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); @@ -6242,12 +6383,33 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) { goto bad; #if PY_VERSION_HEX >= 0x02050000 { - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + /* try package relative import first */ + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + } } #else if (level>0) { @@ -6419,7 +6581,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int64_t(int64_t val) { } static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { - if (s1 == s2) { /* as done by PyObject_RichCompareBool(); also catches the (interned) empty string */ + if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { if (PyBytes_GET_SIZE(s1) != PyBytes_GET_SIZE(s2)) { @@ -6449,16 +6611,26 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq } static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { - if (s1 == s2) { /* as done by PyObject_RichCompareBool(); also catches the (interned) empty string */ + if (s1 == s2) { return (equals == Py_EQ); } else if (PyUnicode_CheckExact(s1) & PyUnicode_CheckExact(s2)) { + #if CYTHON_PEP393_ENABLED + if ((PyUnicode_READY(s1) < 0) || (PyUnicode_READY(s2) < 0)) + return -1; + if (PyUnicode_GET_LENGTH(s1) != PyUnicode_GET_LENGTH(s2)) { + return (equals == Py_NE); + } else if (PyUnicode_GET_LENGTH(s1) == 1) { + Py_UCS4 ch1 = PyUnicode_READ_CHAR(s1, 0); + Py_UCS4 ch2 = PyUnicode_READ_CHAR(s2, 0); + return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2); + #else if (PyUnicode_GET_SIZE(s1) != PyUnicode_GET_SIZE(s2)) { return (equals == Py_NE); } else if (PyUnicode_GET_SIZE(s1) == 1) { - if (equals == Py_EQ) - return (PyUnicode_AS_UNICODE(s1)[0] == PyUnicode_AS_UNICODE(s2)[0]); - else - return (PyUnicode_AS_UNICODE(s1)[0] != PyUnicode_AS_UNICODE(s2)[0]); + Py_UNICODE ch1 = PyUnicode_AS_UNICODE(s1)[0]; + Py_UNICODE ch2 = PyUnicode_AS_UNICODE(s2)[0]; + return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2); + #endif } else { int result = PyUnicode_Compare(s1, s2); if ((result == -1) && unlikely(PyErr_Occurred())) @@ -6916,29 +7088,105 @@ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { return -1; } +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + #include "compile.h" #include "frameobject.h" #include "traceback.h" - -static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno, - int __pyx_lineno, const char *__pyx_filename) { +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(__pyx_filename); + py_srcfile = PyString_FromString(filename); #else - py_srcfile = PyUnicode_FromString(__pyx_filename); + py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; - if (__pyx_clineno) { + if (c_line) { #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { @@ -6949,28 +7197,45 @@ static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno, #endif } if (!py_funcname) goto bad; - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_code = PyCode_New( + py_code = __Pyx_PyCode_New( 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 0, /*int kwonlyargcount,*/ - #endif 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ - __pyx_lineno, /*int firstlineno,*/ + py_line, /*int firstlineno,*/ __pyx_empty_bytes /*PyObject *lnotab*/ ); - if (!py_code) goto bad; + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ @@ -6978,11 +7243,9 @@ static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno, 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; + py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); Py_XDECREF(py_code); Py_XDECREF(py_frame); } @@ -7017,6 +7280,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { return 0; } + /* Type Conversion Functions */ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { diff --git a/setup.py b/setup.py index e02f3c3..8050e8b 100644 --- a/setup.py +++ b/setup.py @@ -82,7 +82,8 @@ def _remove_prefix(string, prefix='hadoopy/'): ext_modules = [Extension("_hadoopy_main", ["hadoopy/_main" + source_ext, "hadoopy/getdelim.c"]), Extension("_hadoopy_typedbytes", ["hadoopy/_typedbytes" + source_ext], - extra_compile_args=tb_extra_args)] + extra_compile_args=tb_extra_args), + Extension("_hadoopy_local", ["hadoopy/_local" + source_ext])] setup(name='hadoopy', cmdclass=cmdclass, version='0.6.0',