Page MenuHomec4science

intbitset.c
No OneTemporary

File Metadata

Created
Wed, Apr 9, 13:23

intbitset.c

This file is larger than 256 KB, so syntax highlighting was skipped.
/* Generated by Cython 0.16 on Mon Jul 23 14:15:08 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 <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
#define __stdcall
#endif
#ifndef __cdecl
#define __cdecl
#endif
#ifndef __fastcall
#define __fastcall
#endif
#endif
#ifndef DL_IMPORT
#define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#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
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#define PY_FORMAT_SIZE_T ""
#define PyInt_FromSsize_t(z) PyInt_FromLong(z)
#define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o)
#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
#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
#define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
#define PyVarObject_HEAD_INIT(type, size) \
PyObject_HEAD_INIT(type) size,
#define PyType_Modified(t)
typedef struct {
void *buf;
PyObject *obj;
Py_ssize_t len;
Py_ssize_t itemsize;
int readonly;
int ndim;
char *format;
Py_ssize_t *shape;
Py_ssize_t *strides;
Py_ssize_t *suboffsets;
void *internal;
} Py_buffer;
#define PyBUF_SIMPLE 0
#define PyBUF_WRITABLE 0x0001
#define PyBUF_FORMAT 0x0004
#define PyBUF_ND 0x0008
#define PyBUF_STRIDES (0x0010 | PyBUF_ND)
#define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
#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
#define Py_TPFLAGS_CHECKTYPES 0
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
#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
#define PyString_Type PyUnicode_Type
#define PyString_Check PyUnicode_Check
#define PyString_CheckExact PyUnicode_CheckExact
#endif
#if PY_VERSION_HEX < 0x02060000
#define PyBytesObject PyStringObject
#define PyBytes_Type PyString_Type
#define PyBytes_Check PyString_Check
#define PyBytes_CheckExact PyString_CheckExact
#define PyBytes_FromString PyString_FromString
#define PyBytes_FromStringAndSize PyString_FromStringAndSize
#define PyBytes_FromFormat PyString_FromFormat
#define PyBytes_DecodeEscape PyString_DecodeEscape
#define PyBytes_AsString PyString_AsString
#define PyBytes_AsStringAndSize PyString_AsStringAndSize
#define PyBytes_Size PyString_Size
#define PyBytes_AS_STRING PyString_AS_STRING
#define PyBytes_GET_SIZE PyString_GET_SIZE
#define PyBytes_Repr PyString_Repr
#define PyBytes_Concat PyString_Concat
#define PyBytes_ConcatAndDel PyString_ConcatAndDel
#endif
#if PY_VERSION_HEX < 0x02060000
#define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
#define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
#define PyInt_Check(op) PyLong_Check(op)
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
#define PyInt_FromString PyLong_FromString
#define PyInt_FromUnicode PyLong_FromUnicode
#define PyInt_FromLong PyLong_FromLong
#define PyInt_FromSize_t PyLong_FromSize_t
#define PyInt_FromSsize_t PyLong_FromSsize_t
#define PyInt_AsLong PyLong_AsLong
#define PyInt_AS_LONG PyLong_AS_LONG
#define PyInt_AsSsize_t PyLong_AsSsize_t
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBoolObject PyLongObject
#endif
#if PY_VERSION_HEX < 0x03020000
typedef long Py_hash_t;
#define __Pyx_PyInt_FromHash_t PyInt_FromLong
#define __Pyx_PyInt_AsHash_t PyInt_AsLong
#else
#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
#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)
#define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
#define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
#define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
#define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
#define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
#else
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
#define __Pyx_NAMESTR(n) ((char *)(n))
#define __Pyx_DOCSTR(n) ((char *)(n))
#else
#define __Pyx_NAMESTR(n) (n)
#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"
#else
#define __PYX_EXTERN_C extern
#endif
#endif
#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__lib__intbitset
#define __PYX_HAVE_API__lib__intbitset
#include "intbitset.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */
#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif
/* inline attribute */
#ifndef CYTHON_INLINE
#if defined(__GNUC__)
#define CYTHON_INLINE __inline__
#elif defined(_MSC_VER)
#define CYTHON_INLINE __inline
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_INLINE inline
#else
#define CYTHON_INLINE
#endif
#endif
/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
/* Type Conversion Predeclarations */
#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s))
#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
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 */
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
static const char *__pyx_f[] = {
"intbitset.pyx",
};
/*--- Type declarations ---*/
struct __pyx_obj_3lib_9intbitset_intbitset_iterator;
struct __pyx_obj_3lib_9intbitset_intbitset;
/* "lib/intbitset.pyx":754
* cdef object __weakref__
*
* cdef class intbitset_iterator: # <<<<<<<<<<<<<<
* cdef int last
* cdef IntBitSet *bitset
*/
struct __pyx_obj_3lib_9intbitset_intbitset_iterator {
PyObject_HEAD
int last;
IntBitSet *bitset;
int sanity_checks;
PyObject *__weakref__;
};
/* "lib/intbitset.pyx":101
* __maxelem__ = maxelem
*
* cdef class intbitset: # <<<<<<<<<<<<<<
* """
* Defines an intbitset data object to hold unordered sets of
*/
struct __pyx_obj_3lib_9intbitset_intbitset {
PyObject_HEAD
IntBitSet *bitset;
int sanity_checks;
PyObject *__weakref__;
};
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
typedef struct {
void (*INCREF)(void*, PyObject*, int);
void (*DECREF)(void*, PyObject*, int);
void (*GOTREF)(void*, PyObject*, int);
void (*GIVEREF)(void*, PyObject*, int);
void* (*SetupContext)(const char*, int, const char*);
void (*FinishContext)(void**);
} __Pyx_RefNannyAPIStruct;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#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__)
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
#define __Pyx_RefNannyDeclarations
#define __Pyx_RefNannySetupContext(name, acquire_gil)
#define __Pyx_RefNannyFinishContext()
#define __Pyx_INCREF(r) Py_INCREF(r)
#define __Pyx_DECREF(r) Py_DECREF(r)
#define __Pyx_GOTREF(r)
#define __Pyx_GIVEREF(r)
#define __Pyx_XINCREF(r) Py_XINCREF(r)
#define __Pyx_XDECREF(r) Py_XDECREF(r)
#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 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*/
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
r = PyObject_GetItem(o, j);
Py_DECREF(j);
return r;
}
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
__Pyx_GetItemInt_List_Fast(o, i) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
if (likely(o != Py_None)) {
if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
Py_INCREF(r);
return r;
}
else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
Py_INCREF(r);
return r;
}
}
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
__Pyx_GetItemInt_Tuple_Fast(o, i) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
if (likely(o != Py_None)) {
if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
Py_INCREF(r);
return r;
}
else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
Py_INCREF(r);
return r;
}
}
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
__Pyx_GetItemInt_Fast(o, i) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
if (PyList_CheckExact(o)) {
Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, n);
Py_INCREF(r);
return r;
}
}
else if (PyTuple_CheckExact(o)) {
Py_ssize_t n = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, n);
Py_INCREF(r);
return r;
}
}
else if (likely(i >= 0)) {
PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
if (likely(m && m->sq_item)) {
return m->sq_item(o, i);
}
}
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact); /*proto*/
static CYTHON_INLINE int __Pyx_div_int(int, int); /* proto */
#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
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*/
static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);
static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_word_t(word_t);
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
static int __Pyx_check_binary_version(void);
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 'lib.intbitset' */
static PyTypeObject *__pyx_ptype_3lib_9intbitset_intbitset = 0;
static PyTypeObject *__pyx_ptype_3lib_9intbitset_intbitset_iterator = 0;
#define __Pyx_MODULE_NAME "lib.intbitset"
int __pyx_module_is_main_lib__intbitset = 0;
/* Implementation of 'lib.intbitset' */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_max;
static PyObject *__pyx_builtin_OverflowError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_MemoryError;
static int __pyx_pf_3lib_9intbitset_9intbitset___cinit__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_rhs, int __pyx_v_preallocate, int __pyx_v_trailing_bits, int __pyx_v_sanity_checks, int __pyx_v_no_allocate); /* proto */
static void __pyx_pf_3lib_9intbitset_9intbitset_2__dealloc__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static int __pyx_pf_3lib_9intbitset_9intbitset_4__contains__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, int __pyx_v_elem); /* proto */
#if PY_MAJOR_VERSION < 3
static int __pyx_pf_3lib_9intbitset_9intbitset_6__cmp__(CYTHON_UNUSED struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs); /* proto */
#endif
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_8__richcmp__(PyObject *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs, int __pyx_v_op); /* proto */
static Py_ssize_t __pyx_pf_3lib_9intbitset_9intbitset_10__len__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static Py_hash_t __pyx_pf_3lib_9intbitset_9intbitset_12__hash__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static int __pyx_pf_3lib_9intbitset_9intbitset_14__nonzero__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_16__iadd__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_18__isub__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_20__deepcopy__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_memo); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_22__del__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, int __pyx_v_elem); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_24__and__(PyObject *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_26__or__(PyObject *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_28__xor__(PyObject *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_30__sub__(PyObject *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_32__iand__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_34__ior__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_36__ixor__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_38__repr__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_40__str__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_42__getitem__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_44__reduce__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_46__iter__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_48add(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, int __pyx_v_elem); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_50clear(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_52discard(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, int __pyx_v_elem); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_54issubset(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_56issuperset(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_58fastdump(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_60fastload(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_strdump); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_62copy(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_64pop(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_66remove(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, int __pyx_v_elem); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_68strbits(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_70update_with_signs(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_72get_size(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_74get_allocated(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_76is_infinite(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_78extract_finite_list(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, int __pyx_v_up_to); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_80get_wordbitsize(CYTHON_UNUSED struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_82get_wordbytsize(CYTHON_UNUSED struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_84tolist(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self); /* proto */
static int __pyx_pf_3lib_9intbitset_18intbitset_iterator___cinit__(struct __pyx_obj_3lib_9intbitset_intbitset_iterator *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_bitset); /* proto */
static void __pyx_pf_3lib_9intbitset_18intbitset_iterator_2__dealloc__(struct __pyx_obj_3lib_9intbitset_intbitset_iterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_18intbitset_iterator_4__next__(struct __pyx_obj_3lib_9intbitset_intbitset_iterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3lib_9intbitset_18intbitset_iterator_6__iter__(struct __pyx_obj_3lib_9intbitset_intbitset_iterator *__pyx_v_self); /* proto */
static char __pyx_k_2[] = "rhs can't be negative";
static char __pyx_k_4[] = "Buffer error!!!";
static char __pyx_k_6[] = "rhs is corrupted: %s";
static char __pyx_k_7[] = "Can't store integers bigger than %s";
static char __pyx_k_8[] = "Negative numbers, not allowed";
static char __pyx_k_10[] = "Elements must be <= %s";
static char __pyx_k_14[] = "retrieving integers from rhs is impossible: %s";
static char __pyx_k_15[] = "rhs is of unknown type %s";
static char __pyx_k_17[] = "Element must be <= %s";
static char __pyx_k_18[] = "cannot compare intbitset using cmp()";
static char __pyx_k_21[] = "rhs must be <= %s";
static char __pyx_k_27[] = "intbitset(%s, trailing_bits=True)";
static char __pyx_k_28[] = "intbitset(%s)";
static char __pyx_k_29[] = "intbitset([";
static char __pyx_k_30[] = "%i, ";
static char __pyx_k_31[] = "...])";
static char __pyx_k_32[] = "..., ";
static char __pyx_k_33[] = "])";
static char __pyx_k_34[] = "negative indexes are not allowed on infinite intbitset";
static char __pyx_k_36[] = "negative steps are not yet supported";
static char __pyx_k_39[] = "intbitset index out of range";
static char __pyx_k_42[] = "It's impossible to iterate over an infinite set.";
static char __pyx_k_46[] = "strdump is corrupted";
static char __pyx_k_48[] = "pop from an empty or infinite intbitset";
static char __pyx_k_51[] = "It's impossible to print an infinite set.";
static char __pyx_k_53[] = "";
static char __pyx_k_55[] = "Elements must <= %s";
static char __pyx_k_56[] = "rhs should be a valid dictionary with integers keys and integer values";
static char __pyx_k_58[] = "up_to must be <= %s";
static char __pyx_k_59[] = "It's impossible to retrieve a list of an infinite set";
static char __pyx_k_61[] = "CFG_INTBITSET_ENABLE_SANITY_CHECKS";
static char __pyx_k_62[] = "intbitset corrupted: allocated: %s, size: %s";
static char __pyx_k_63[] = "$Id$";
static char __pyx_k_64[] = "invenio.config";
static char __pyx_k_65[] = "invenio.intbitset_helper";
static char __pyx_k_66[] = "__safe_for_unpickling__";
static char __pyx_k_67[] = "symmetric_difference";
static char __pyx_k_68[] = "symmetric_difference_update";
static char __pyx_k__0[] = "0";
static char __pyx_k__1[] = "1";
static char __pyx_k___[] = "_";
static char __pyx_k__add[] = "add";
static char __pyx_k__max[] = "max";
static char __pyx_k__rhs[] = "rhs";
static char __pyx_k__sys[] = "sys";
static char __pyx_k__join[] = "join";
static char __pyx_k__stop[] = "stop";
static char __pyx_k__zlib[] = "zlib";
static char __pyx_k__Error[] = "Error";
static char __pyx_k__array[] = "array";
static char __pyx_k__range[] = "range";
static char __pyx_k__start[] = "start";
static char __pyx_k__union[] = "union";
static char __pyx_k__up_to[] = "up_to";
static char __pyx_k____ge__[] = "__ge__";
static char __pyx_k____le__[] = "__le__";
static char __pyx_k____or__[] = "__or__";
static char __pyx_k__bitset[] = "bitset";
static char __pyx_k____all__[] = "__all__";
static char __pyx_k____and__[] = "__and__";
static char __pyx_k____ior__[] = "__ior__";
static char __pyx_k____sub__[] = "__sub__";
static char __pyx_k____xor__[] = "__xor__";
static char __pyx_k__indices[] = "indices";
static char __pyx_k__KeyError[] = "KeyError";
static char __pyx_k____iand__[] = "__iand__";
static char __pyx_k____isub__[] = "__isub__";
static char __pyx_k____iter__[] = "__iter__";
static char __pyx_k____ixor__[] = "__ixor__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____repr__[] = "__repr__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__compress[] = "compress";
static char __pyx_k__fastdump[] = "fastdump";
static char __pyx_k__tostring[] = "tostring";
static char __pyx_k__Exception[] = "Exception";
static char __pyx_k__TypeError[] = "TypeError";
static char __pyx_k__intbitset[] = "intbitset";
static char __pyx_k__iteritems[] = "iteritems";
static char __pyx_k__IndexError[] = "IndexError";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k__decompress[] = "decompress";
static char __pyx_k__difference[] = "difference";
static char __pyx_k__MemoryError[] = "MemoryError";
static char __pyx_k____getitem__[] = "__getitem__";
static char __pyx_k____maxelem__[] = "__maxelem__";
static char __pyx_k__no_allocate[] = "no_allocate";
static char __pyx_k__preallocate[] = "preallocate";
static char __pyx_k____apilevel__[] = "__apilevel__";
static char __pyx_k____revision__[] = "__revision__";
static char __pyx_k__intersection[] = "intersection";
static char __pyx_k__union_update[] = "union_update";
static char __pyx_k__OverflowError[] = "OverflowError";
static char __pyx_k__StopIteration[] = "StopIteration";
static char __pyx_k__sanity_checks[] = "sanity_checks";
static char __pyx_k__trailing_bits[] = "trailing_bits";
static char __pyx_k__AttributeError[] = "AttributeError";
static char __pyx_k__difference_update[] = "difference_update";
static char __pyx_k__extract_finite_list[] = "extract_finite_list";
static char __pyx_k__intersection_update[] = "intersection_update";
static PyObject *__pyx_kp_s_10;
static PyObject *__pyx_kp_s_14;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_kp_s_17;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_27;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_kp_s_31;
static PyObject *__pyx_kp_s_32;
static PyObject *__pyx_kp_s_33;
static PyObject *__pyx_kp_s_34;
static PyObject *__pyx_kp_s_36;
static PyObject *__pyx_kp_s_39;
static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_kp_s_42;
static PyObject *__pyx_kp_s_46;
static PyObject *__pyx_kp_s_48;
static PyObject *__pyx_kp_s_51;
static PyObject *__pyx_kp_s_53;
static PyObject *__pyx_kp_s_55;
static PyObject *__pyx_kp_s_56;
static PyObject *__pyx_kp_s_58;
static PyObject *__pyx_kp_s_59;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_n_s_61;
static PyObject *__pyx_kp_s_62;
static PyObject *__pyx_kp_s_63;
static PyObject *__pyx_n_s_64;
static PyObject *__pyx_n_s_65;
static PyObject *__pyx_n_s_66;
static PyObject *__pyx_n_s_67;
static PyObject *__pyx_n_s_68;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_kp_s_8;
static PyObject *__pyx_kp_s__0;
static PyObject *__pyx_kp_s__1;
static PyObject *__pyx_n_s__AttributeError;
static PyObject *__pyx_n_s__Error;
static PyObject *__pyx_n_s__Exception;
static PyObject *__pyx_n_s__IndexError;
static PyObject *__pyx_n_s__KeyError;
static PyObject *__pyx_n_s__MemoryError;
static PyObject *__pyx_n_s__OverflowError;
static PyObject *__pyx_n_s__StopIteration;
static PyObject *__pyx_n_s__TypeError;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s___;
static PyObject *__pyx_n_s____all__;
static PyObject *__pyx_n_s____and__;
static PyObject *__pyx_n_s____apilevel__;
static PyObject *__pyx_n_s____ge__;
static PyObject *__pyx_n_s____getitem__;
static PyObject *__pyx_n_s____iand__;
static PyObject *__pyx_n_s____ior__;
static PyObject *__pyx_n_s____isub__;
static PyObject *__pyx_n_s____iter__;
static PyObject *__pyx_n_s____ixor__;
static PyObject *__pyx_n_s____le__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____maxelem__;
static PyObject *__pyx_n_s____or__;
static PyObject *__pyx_n_s____repr__;
static PyObject *__pyx_n_s____revision__;
static PyObject *__pyx_n_s____sub__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s____xor__;
static PyObject *__pyx_n_s__add;
static PyObject *__pyx_n_s__array;
static PyObject *__pyx_n_s__bitset;
static PyObject *__pyx_n_s__compress;
static PyObject *__pyx_n_s__decompress;
static PyObject *__pyx_n_s__difference;
static PyObject *__pyx_n_s__difference_update;
static PyObject *__pyx_n_s__extract_finite_list;
static PyObject *__pyx_n_s__fastdump;
static PyObject *__pyx_n_s__indices;
static PyObject *__pyx_n_s__intbitset;
static PyObject *__pyx_n_s__intersection;
static PyObject *__pyx_n_s__intersection_update;
static PyObject *__pyx_n_s__iteritems;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__max;
static PyObject *__pyx_n_s__no_allocate;
static PyObject *__pyx_n_s__preallocate;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__rhs;
static PyObject *__pyx_n_s__sanity_checks;
static PyObject *__pyx_n_s__start;
static PyObject *__pyx_n_s__stop;
static PyObject *__pyx_n_s__sys;
static PyObject *__pyx_n_s__tostring;
static PyObject *__pyx_n_s__trailing_bits;
static PyObject *__pyx_n_s__union;
static PyObject *__pyx_n_s__union_update;
static PyObject *__pyx_n_s__up_to;
static PyObject *__pyx_n_s__zlib;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static int __pyx_k_1;
static PyObject *__pyx_k_tuple_3;
static PyObject *__pyx_k_tuple_5;
static PyObject *__pyx_k_tuple_9;
static PyObject *__pyx_k_tuple_11;
static PyObject *__pyx_k_tuple_12;
static PyObject *__pyx_k_tuple_13;
static PyObject *__pyx_k_tuple_16;
static PyObject *__pyx_k_tuple_19;
static PyObject *__pyx_k_tuple_20;
static PyObject *__pyx_k_tuple_22;
static PyObject *__pyx_k_tuple_23;
static PyObject *__pyx_k_tuple_24;
static PyObject *__pyx_k_tuple_25;
static PyObject *__pyx_k_tuple_26;
static PyObject *__pyx_k_tuple_35;
static PyObject *__pyx_k_tuple_37;
static PyObject *__pyx_k_tuple_38;
static PyObject *__pyx_k_tuple_40;
static PyObject *__pyx_k_tuple_41;
static PyObject *__pyx_k_tuple_43;
static PyObject *__pyx_k_tuple_44;
static PyObject *__pyx_k_tuple_45;
static PyObject *__pyx_k_tuple_47;
static PyObject *__pyx_k_tuple_49;
static PyObject *__pyx_k_tuple_50;
static PyObject *__pyx_k_tuple_52;
static PyObject *__pyx_k_tuple_54;
static PyObject *__pyx_k_tuple_57;
static PyObject *__pyx_k_tuple_60;
/* Python wrapper */
static int __pyx_pw_3lib_9intbitset_9intbitset_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3lib_9intbitset_9intbitset_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rhs = 0;
int __pyx_v_preallocate;
int __pyx_v_trailing_bits;
int __pyx_v_sanity_checks;
int __pyx_v_no_allocate;
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__rhs,&__pyx_n_s__preallocate,&__pyx_n_s__trailing_bits,&__pyx_n_s__sanity_checks,&__pyx_n_s__no_allocate,0};
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
{
PyObject* values[5] = {0,0,0,0,0};
values[0] = ((PyObject *)__pyx_int_0);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_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);
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 (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rhs);
if (value) { values[0] = value; kw_args--; }
}
case 1:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__preallocate);
if (value) { values[1] = value; kw_args--; }
}
case 2:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__trailing_bits);
if (value) { values[2] = value; kw_args--; }
}
case 3:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sanity_checks);
if (value) { values[3] = value; kw_args--; }
}
case 4:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__no_allocate);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
if (values[1]) {
} else {
__pyx_v_preallocate = ((int)-1);
}
if (values[2]) {
} else {
__pyx_v_trailing_bits = ((int)0);
}
if (values[3]) {
} else {
__pyx_v_sanity_checks = __pyx_k_1;
}
if (values[4]) {
} else {
__pyx_v_no_allocate = ((int)0);
}
} else {
switch (PyTuple_GET_SIZE(__pyx_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);
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;
}
}
__pyx_v_rhs = values[0];
if (values[1]) {
__pyx_v_preallocate = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_preallocate == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_preallocate = ((int)-1);
}
if (values[2]) {
__pyx_v_trailing_bits = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_trailing_bits == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_trailing_bits = ((int)0);
}
if (values[3]) {
__pyx_v_sanity_checks = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_sanity_checks == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_sanity_checks = __pyx_k_1;
}
if (values[4]) {
__pyx_v_no_allocate = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_no_allocate == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_no_allocate = ((int)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("lib.intbitset.intbitset.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset___cinit__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), __pyx_v_rhs, __pyx_v_preallocate, __pyx_v_trailing_bits, __pyx_v_sanity_checks, __pyx_v_no_allocate);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":142
* cdef bint sanity_checks
*
* def __cinit__(self, rhs=0, int preallocate=-1, int trailing_bits=0, bint sanity_checks=CFG_INTBITSET_ENABLE_SANITY_CHECKS, int no_allocate=0): # <<<<<<<<<<<<<<
* """
* Initialize intbitset.
*/
static int __pyx_pf_3lib_9intbitset_9intbitset___cinit__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_rhs, int __pyx_v_preallocate, int __pyx_v_trailing_bits, int __pyx_v_sanity_checks, int __pyx_v_no_allocate) {
Py_ssize_t __pyx_v_size;
const void* __pyx_v_buf;
int __pyx_v_elem;
int __pyx_v_last;
int __pyx_v_remelem;
int __pyx_v_tuple_of_tuples;
PyObject *__pyx_v_msg = NULL;
PyObject *__pyx_v_tmp = NULL;
PyObject *__pyx_v_tmp_tuple = NULL;
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
int __pyx_t_8;
int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
Py_ssize_t __pyx_t_14;
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
PyObject *(*__pyx_t_17)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
__Pyx_INCREF(__pyx_v_rhs);
/* "lib/intbitset.pyx":162
* after the biggest one added with rhs.
* """
* cdef Py_ssize_t size = 0 # <<<<<<<<<<<<<<
* cdef const_void_ptr buf = NULL
* cdef int elem
*/
__pyx_v_size = 0;
/* "lib/intbitset.pyx":163
* """
* cdef Py_ssize_t size = 0
* cdef const_void_ptr buf = NULL # <<<<<<<<<<<<<<
* cdef int elem
* cdef int i
*/
__pyx_v_buf = NULL;
/* "lib/intbitset.pyx":169
* cdef int remelem
* cdef bint tuple_of_tuples
* self.sanity_checks = sanity_checks # <<<<<<<<<<<<<<
* #print >> sys.stderr, "intbitset.__cinit__ is called"
* msg = "Error"
*/
__pyx_v_self->sanity_checks = __pyx_v_sanity_checks;
/* "lib/intbitset.pyx":171
* self.sanity_checks = sanity_checks
* #print >> sys.stderr, "intbitset.__cinit__ is called"
* msg = "Error" # <<<<<<<<<<<<<<
* self.bitset = NULL
* try:
*/
__Pyx_INCREF(((PyObject *)__pyx_n_s__Error));
__pyx_v_msg = ((PyObject *)__pyx_n_s__Error);
/* "lib/intbitset.pyx":172
* #print >> sys.stderr, "intbitset.__cinit__ is called"
* msg = "Error"
* self.bitset = NULL # <<<<<<<<<<<<<<
* try:
* if no_allocate:
*/
__pyx_v_self->bitset = NULL;
/* "lib/intbitset.pyx":173
* msg = "Error"
* self.bitset = NULL
* try: # <<<<<<<<<<<<<<
* if no_allocate:
* return
*/
{
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "lib/intbitset.pyx":174
* self.bitset = NULL
* try:
* if no_allocate: # <<<<<<<<<<<<<<
* return
* if type(rhs) in (int, long):
*/
if (__pyx_v_no_allocate) {
/* "lib/intbitset.pyx":175
* try:
* if no_allocate:
* return # <<<<<<<<<<<<<<
* if type(rhs) in (int, long):
* if rhs < 0:
*/
__pyx_r = 0;
goto __pyx_L7_try_return;
goto __pyx_L11;
}
__pyx_L11:;
/* "lib/intbitset.pyx":176
* if no_allocate:
* return
* if type(rhs) in (int, long): # <<<<<<<<<<<<<<
* if rhs < 0:
* raise ValueError("rhs can't be negative")
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_rhs)));
__pyx_t_4 = ((PyObject *)Py_TYPE(__pyx_v_rhs));
__pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_t_4), ((PyObject *)((PyObject*)(&PyInt_Type))), Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!((int)__pyx_t_6)) {
__pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_t_4), ((PyObject *)((PyObject*)(&PyLong_Type))), Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = ((int)__pyx_t_7);
} else {
__pyx_t_8 = ((int)__pyx_t_6);
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __pyx_t_8;
if (__pyx_t_6) {
/* "lib/intbitset.pyx":177
* return
* if type(rhs) in (int, long):
* if rhs < 0: # <<<<<<<<<<<<<<
* raise ValueError("rhs can't be negative")
* self.bitset = intBitSetCreate(rhs, trailing_bits)
*/
__pyx_t_4 = PyObject_RichCompare(__pyx_v_rhs, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
/* "lib/intbitset.pyx":178
* if type(rhs) in (int, long):
* if rhs < 0:
* raise ValueError("rhs can't be negative") # <<<<<<<<<<<<<<
* self.bitset = intBitSetCreate(rhs, trailing_bits)
* elif type(rhs) is intbitset:
*/
__pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
goto __pyx_L13;
}
__pyx_L13:;
/* "lib/intbitset.pyx":179
* if rhs < 0:
* raise ValueError("rhs can't be negative")
* self.bitset = intBitSetCreate(rhs, trailing_bits) # <<<<<<<<<<<<<<
* elif type(rhs) is intbitset:
* self.bitset = intBitSetClone((<intbitset>rhs).bitset)
*/
__pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_rhs); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_v_self->bitset = intBitSetCreate(__pyx_t_9, __pyx_v_trailing_bits);
goto __pyx_L12;
}
/* "lib/intbitset.pyx":180
* raise ValueError("rhs can't be negative")
* self.bitset = intBitSetCreate(rhs, trailing_bits)
* elif type(rhs) is intbitset: # <<<<<<<<<<<<<<
* self.bitset = intBitSetClone((<intbitset>rhs).bitset)
* elif type(rhs) in (str, array):
*/
__pyx_t_6 = (((PyObject *)Py_TYPE(__pyx_v_rhs)) == ((PyObject *)((PyObject*)__pyx_ptype_3lib_9intbitset_intbitset)));
if (__pyx_t_6) {
/* "lib/intbitset.pyx":181
* self.bitset = intBitSetCreate(rhs, trailing_bits)
* elif type(rhs) is intbitset:
* self.bitset = intBitSetClone((<intbitset>rhs).bitset) # <<<<<<<<<<<<<<
* elif type(rhs) in (str, array):
* try:
*/
__pyx_v_self->bitset = intBitSetClone(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_rhs)->bitset);
goto __pyx_L12;
}
/* "lib/intbitset.pyx":182
* elif type(rhs) is intbitset:
* self.bitset = intBitSetClone((<intbitset>rhs).bitset)
* elif type(rhs) in (str, array): # <<<<<<<<<<<<<<
* try:
* if type(rhs) is array:
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_rhs)));
__pyx_t_4 = ((PyObject *)Py_TYPE(__pyx_v_rhs));
__pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_t_4), ((PyObject *)((PyObject*)(&PyString_Type))), Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!((int)__pyx_t_6)) {
__pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_10 = PyObject_RichCompare(((PyObject *)__pyx_t_4), __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_7 = ((int)__pyx_t_8);
} else {
__pyx_t_7 = ((int)__pyx_t_6);
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __pyx_t_7;
if (__pyx_t_6) {
/* "lib/intbitset.pyx":183
* self.bitset = intBitSetClone((<intbitset>rhs).bitset)
* elif type(rhs) in (str, array):
* try: # <<<<<<<<<<<<<<
* if type(rhs) is array:
* rhs = rhs.tostring()
*/
{
__Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
__Pyx_XGOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_t_13);
/*try:*/ {
/* "lib/intbitset.pyx":184
* elif type(rhs) in (str, array):
* try:
* if type(rhs) is array: # <<<<<<<<<<<<<<
* rhs = rhs.tostring()
* tmp = zlib.decompress(rhs)
*/
__pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = (((PyObject *)Py_TYPE(__pyx_v_rhs)) == __pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
/* "lib/intbitset.pyx":185
* try:
* if type(rhs) is array:
* rhs = rhs.tostring() # <<<<<<<<<<<<<<
* tmp = zlib.decompress(rhs)
* if PyObject_AsReadBuffer(tmp, &buf, &size) < 0:
*/
__pyx_t_4 = PyObject_GetAttr(__pyx_v_rhs, __pyx_n_s__tostring); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_v_rhs);
__pyx_v_rhs = __pyx_t_10;
__pyx_t_10 = 0;
goto __pyx_L22;
}
__pyx_L22:;
/* "lib/intbitset.pyx":186
* if type(rhs) is array:
* rhs = rhs.tostring()
* tmp = zlib.decompress(rhs) # <<<<<<<<<<<<<<
* if PyObject_AsReadBuffer(tmp, &buf, &size) < 0:
* raise Exception("Buffer error!!!")
*/
__pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__zlib); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_4 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__decompress); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_v_rhs);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_rhs);
__Pyx_GIVEREF(__pyx_v_rhs);
__pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
__pyx_v_tmp = __pyx_t_5;
__pyx_t_5 = 0;
/* "lib/intbitset.pyx":187
* rhs = rhs.tostring()
* tmp = zlib.decompress(rhs)
* if PyObject_AsReadBuffer(tmp, &buf, &size) < 0: # <<<<<<<<<<<<<<
* raise Exception("Buffer error!!!")
* if (size % wordbytesize):
*/
__pyx_t_6 = (PyObject_AsReadBuffer(__pyx_v_tmp, (&__pyx_v_buf), (&__pyx_v_size)) < 0);
if (__pyx_t_6) {
/* "lib/intbitset.pyx":188
* tmp = zlib.decompress(rhs)
* if PyObject_AsReadBuffer(tmp, &buf, &size) < 0:
* raise Exception("Buffer error!!!") # <<<<<<<<<<<<<<
* if (size % wordbytesize):
* ## Wrong size!
*/
__pyx_t_5 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
goto __pyx_L23;
}
__pyx_L23:;
/* "lib/intbitset.pyx":189
* if PyObject_AsReadBuffer(tmp, &buf, &size) < 0:
* raise Exception("Buffer error!!!")
* if (size % wordbytesize): # <<<<<<<<<<<<<<
* ## Wrong size!
* raise Exception()
*/
if (unlikely(wordbytesize == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
}
__pyx_t_14 = __Pyx_mod_Py_ssize_t(__pyx_v_size, wordbytesize);
if (__pyx_t_14) {
/* "lib/intbitset.pyx":191
* if (size % wordbytesize):
* ## Wrong size!
* raise Exception() # <<<<<<<<<<<<<<
* self.bitset = intBitSetCreateFromBuffer(buf, size)
* except Exception, msg:
*/
__pyx_t_5 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
goto __pyx_L24;
}
__pyx_L24:;
/* "lib/intbitset.pyx":192
* ## Wrong size!
* raise Exception()
* self.bitset = intBitSetCreateFromBuffer(buf, size) # <<<<<<<<<<<<<<
* except Exception, msg:
* raise ValueError("rhs is corrupted: %s" % msg)
*/
__pyx_v_self->bitset = intBitSetCreateFromBuffer(__pyx_v_buf, __pyx_v_size);
}
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
goto __pyx_L21_try_end;
__pyx_L14_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "lib/intbitset.pyx":193
* raise Exception()
* self.bitset = intBitSetCreateFromBuffer(buf, size)
* except Exception, msg: # <<<<<<<<<<<<<<
* raise ValueError("rhs is corrupted: %s" % msg)
* elif hasattr(rhs, '__iter__'):
*/
__pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
if (__pyx_t_9) {
__Pyx_AddTraceback("lib.intbitset.intbitset.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_10, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_10);
__Pyx_DECREF(__pyx_v_msg);
__pyx_v_msg = __pyx_t_10;
/* "lib/intbitset.pyx":194
* self.bitset = intBitSetCreateFromBuffer(buf, size)
* except Exception, msg:
* raise ValueError("rhs is corrupted: %s" % msg) # <<<<<<<<<<<<<<
* elif hasattr(rhs, '__iter__'):
* tuple_of_tuples = rhs and hasattr(rhs[0], '__getitem__')
*/
__pyx_t_15 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_v_msg); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_15));
__pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
__Pyx_GOTREF(__pyx_t_16);
PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)__pyx_t_15));
__Pyx_GIVEREF(((PyObject *)__pyx_t_15));
__pyx_t_15 = 0;
__pyx_t_15 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
__Pyx_Raise(__pyx_t_15, 0, 0, 0);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L15_exception_handled;
}
__pyx_L16_except_error:;
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
goto __pyx_L3_error;
__pyx_L15_exception_handled:;
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
__pyx_L21_try_end:;
}
goto __pyx_L12;
}
/* "lib/intbitset.pyx":195
* except Exception, msg:
* raise ValueError("rhs is corrupted: %s" % msg)
* elif hasattr(rhs, '__iter__'): # <<<<<<<<<<<<<<
* tuple_of_tuples = rhs and hasattr(rhs[0], '__getitem__')
* try:
*/
__pyx_t_4 = ((PyObject *)__pyx_n_s____iter__);
__Pyx_INCREF(__pyx_t_4);
__pyx_t_6 = PyObject_HasAttr(__pyx_v_rhs, __pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
/* "lib/intbitset.pyx":196
* raise ValueError("rhs is corrupted: %s" % msg)
* elif hasattr(rhs, '__iter__'):
* tuple_of_tuples = rhs and hasattr(rhs[0], '__getitem__') # <<<<<<<<<<<<<<
* try:
* if preallocate < 0:
*/
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_rhs); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
if (__pyx_t_6) {
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_rhs, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_10 = ((PyObject *)__pyx_n_s____getitem__);
__Pyx_INCREF(__pyx_t_10);
__pyx_t_6 = PyObject_HasAttr(__pyx_t_4, __pyx_t_10); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_4 = __pyx_t_10;
__pyx_t_10 = 0;
} else {
__Pyx_INCREF(__pyx_v_rhs);
__pyx_t_4 = __pyx_v_rhs;
}
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_tuple_of_tuples = __pyx_t_6;
/* "lib/intbitset.pyx":197
* elif hasattr(rhs, '__iter__'):
* tuple_of_tuples = rhs and hasattr(rhs[0], '__getitem__')
* try: # <<<<<<<<<<<<<<
* if preallocate < 0:
* if rhs and type(rhs[0]) is int:
*/
{
__Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_13);
__Pyx_XGOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_t_11);
/*try:*/ {
/* "lib/intbitset.pyx":198
* tuple_of_tuples = rhs and hasattr(rhs[0], '__getitem__')
* try:
* if preallocate < 0: # <<<<<<<<<<<<<<
* if rhs and type(rhs[0]) is int:
* preallocate = max(rhs)
*/
__pyx_t_6 = (__pyx_v_preallocate < 0);
if (__pyx_t_6) {
/* "lib/intbitset.pyx":199
* try:
* if preallocate < 0:
* if rhs and type(rhs[0]) is int: # <<<<<<<<<<<<<<
* preallocate = max(rhs)
* else:
*/
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_rhs); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
if (__pyx_t_6) {
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_rhs, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_t_4)) == ((PyObject *)((PyObject*)(&PyInt_Type))));
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_8 = __pyx_t_7;
} else {
__pyx_t_8 = __pyx_t_6;
}
if (__pyx_t_8) {
/* "lib/intbitset.pyx":200
* if preallocate < 0:
* if rhs and type(rhs[0]) is int:
* preallocate = max(rhs) # <<<<<<<<<<<<<<
* else:
* preallocate = 0
*/
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_rhs);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_rhs);
__Pyx_GIVEREF(__pyx_v_rhs);
__pyx_t_10 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_v_preallocate = __pyx_t_9;
goto __pyx_L36;
}
/*else*/ {
/* "lib/intbitset.pyx":202
* preallocate = max(rhs)
* else:
* preallocate = 0 # <<<<<<<<<<<<<<
* if self.sanity_checks:
* if not (0 <= preallocate < maxelem):
*/
__pyx_v_preallocate = 0;
}
__pyx_L36:;
goto __pyx_L35;
}
__pyx_L35:;
/* "lib/intbitset.pyx":203
* else:
* preallocate = 0
* if self.sanity_checks: # <<<<<<<<<<<<<<
* if not (0 <= preallocate < maxelem):
* raise OverflowError("Can't store integers bigger than %s" % maxelem)
*/
if (__pyx_v_self->sanity_checks) {
/* "lib/intbitset.pyx":204
* preallocate = 0
* if self.sanity_checks:
* if not (0 <= preallocate < maxelem): # <<<<<<<<<<<<<<
* raise OverflowError("Can't store integers bigger than %s" % maxelem)
* self.bitset = intBitSetCreate(preallocate, trailing_bits)
*/
__pyx_t_8 = (0 <= __pyx_v_preallocate);
if (__pyx_t_8) {
__pyx_t_8 = (__pyx_v_preallocate < maxelem);
}
__pyx_t_6 = (!__pyx_t_8);
if (__pyx_t_6) {
/* "lib/intbitset.pyx":205
* if self.sanity_checks:
* if not (0 <= preallocate < maxelem):
* raise OverflowError("Can't store integers bigger than %s" % maxelem) # <<<<<<<<<<<<<<
* self.bitset = intBitSetCreate(preallocate, trailing_bits)
* if trailing_bits:
*/
__pyx_t_10 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
__pyx_t_4 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 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 = 205; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
goto __pyx_L38;
}
__pyx_L38:;
goto __pyx_L37;
}
__pyx_L37:;
/* "lib/intbitset.pyx":206
* if not (0 <= preallocate < maxelem):
* raise OverflowError("Can't store integers bigger than %s" % maxelem)
* self.bitset = intBitSetCreate(preallocate, trailing_bits) # <<<<<<<<<<<<<<
* if trailing_bits:
* last = 0
*/
__pyx_v_self->bitset = intBitSetCreate(__pyx_v_preallocate, __pyx_v_trailing_bits);
/* "lib/intbitset.pyx":207
* raise OverflowError("Can't store integers bigger than %s" % maxelem)
* self.bitset = intBitSetCreate(preallocate, trailing_bits)
* if trailing_bits: # <<<<<<<<<<<<<<
* last = 0
* if self.sanity_checks:
*/
if (__pyx_v_trailing_bits) {
/* "lib/intbitset.pyx":208
* self.bitset = intBitSetCreate(preallocate, trailing_bits)
* if trailing_bits:
* last = 0 # <<<<<<<<<<<<<<
* if self.sanity_checks:
* if tuple_of_tuples:
*/
__pyx_v_last = 0;
/* "lib/intbitset.pyx":209
* if trailing_bits:
* last = 0
* if self.sanity_checks: # <<<<<<<<<<<<<<
* if tuple_of_tuples:
* for tmp_tuple in rhs:
*/
if (__pyx_v_self->sanity_checks) {
/* "lib/intbitset.pyx":210
* last = 0
* if self.sanity_checks:
* if tuple_of_tuples: # <<<<<<<<<<<<<<
* for tmp_tuple in rhs:
* elem = tmp_tuple[0]
*/
if (__pyx_v_tuple_of_tuples) {
/* "lib/intbitset.pyx":211
* if self.sanity_checks:
* if tuple_of_tuples:
* for tmp_tuple in rhs: # <<<<<<<<<<<<<<
* elem = tmp_tuple[0]
* if elem < 0:
*/
if (PyList_CheckExact(__pyx_v_rhs) || PyTuple_CheckExact(__pyx_v_rhs)) {
__pyx_t_4 = __pyx_v_rhs; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0;
__pyx_t_17 = NULL;
} else {
__pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
for (;;) {
if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break;
__pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++;
} else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
__pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++;
} else {
__pyx_t_10 = __pyx_t_17(__pyx_t_4);
if (unlikely(!__pyx_t_10)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_10);
}
__Pyx_XDECREF(__pyx_v_tmp_tuple);
__pyx_v_tmp_tuple = __pyx_t_10;
__pyx_t_10 = 0;
/* "lib/intbitset.pyx":212
* if tuple_of_tuples:
* for tmp_tuple in rhs:
* elem = tmp_tuple[0] # <<<<<<<<<<<<<<
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
*/
__pyx_t_10 = __Pyx_GetItemInt(__pyx_v_tmp_tuple, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_v_elem = __pyx_t_9;
/* "lib/intbitset.pyx":213
* for tmp_tuple in rhs:
* elem = tmp_tuple[0]
* if elem < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
*/
__pyx_t_6 = (__pyx_v_elem < 0);
if (__pyx_t_6) {
/* "lib/intbitset.pyx":214
* elem = tmp_tuple[0]
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_Raise(__pyx_t_10, 0, 0, 0);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
goto __pyx_L44;
}
/* "lib/intbitset.pyx":215
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("Elements must be <= %s" % maxelem)
* for remelem from last <= remelem < elem:
*/
__pyx_t_6 = (__pyx_v_elem > maxelem);
if (__pyx_t_6) {
/* "lib/intbitset.pyx":216
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* for remelem from last <= remelem < elem:
* intBitSetDelElem(self.bitset, remelem)
*/
__pyx_t_10 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_5));
__Pyx_GIVEREF(((PyObject *)__pyx_t_5));
__pyx_t_5 = 0;
__pyx_t_5 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 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 = 216; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
goto __pyx_L44;
}
__pyx_L44:;
/* "lib/intbitset.pyx":217
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
* for remelem from last <= remelem < elem: # <<<<<<<<<<<<<<
* intBitSetDelElem(self.bitset, remelem)
* last = elem + 1
*/
__pyx_t_9 = __pyx_v_elem;
for (__pyx_v_remelem = __pyx_v_last; __pyx_v_remelem < __pyx_t_9; __pyx_v_remelem++) {
/* "lib/intbitset.pyx":218
* raise OverflowError("Elements must be <= %s" % maxelem)
* for remelem from last <= remelem < elem:
* intBitSetDelElem(self.bitset, remelem) # <<<<<<<<<<<<<<
* last = elem + 1
* else:
*/
intBitSetDelElem(__pyx_v_self->bitset, __pyx_v_remelem);
}
/* "lib/intbitset.pyx":219
* for remelem from last <= remelem < elem:
* intBitSetDelElem(self.bitset, remelem)
* last = elem + 1 # <<<<<<<<<<<<<<
* else:
* for elem in rhs:
*/
__pyx_v_last = (__pyx_v_elem + 1);
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L41;
}
/*else*/ {
/* "lib/intbitset.pyx":221
* last = elem + 1
* else:
* for elem in rhs: # <<<<<<<<<<<<<<
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
*/
if (PyList_CheckExact(__pyx_v_rhs) || PyTuple_CheckExact(__pyx_v_rhs)) {
__pyx_t_4 = __pyx_v_rhs; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0;
__pyx_t_17 = NULL;
} else {
__pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
for (;;) {
if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break;
__pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++;
} else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++;
} else {
__pyx_t_5 = __pyx_t_17(__pyx_t_4);
if (unlikely(!__pyx_t_5)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_elem = __pyx_t_9;
/* "lib/intbitset.pyx":222
* else:
* for elem in rhs:
* if elem < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
*/
__pyx_t_6 = (__pyx_v_elem < 0);
if (__pyx_t_6) {
/* "lib/intbitset.pyx":223
* for elem in rhs:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
goto __pyx_L49;
}
/* "lib/intbitset.pyx":224
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("Elements must be <= %s" % maxelem)
* for remelem from last <= remelem < elem:
*/
__pyx_t_6 = (__pyx_v_elem > maxelem);
if (__pyx_t_6) {
/* "lib/intbitset.pyx":225
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* for remelem from last <= remelem < elem:
* intBitSetDelElem(self.bitset, remelem)
*/
__pyx_t_5 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_10));
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_10));
__Pyx_GIVEREF(((PyObject *)__pyx_t_10));
__pyx_t_10 = 0;
__pyx_t_10 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_10, 0, 0, 0);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
goto __pyx_L49;
}
__pyx_L49:;
/* "lib/intbitset.pyx":226
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
* for remelem from last <= remelem < elem: # <<<<<<<<<<<<<<
* intBitSetDelElem(self.bitset, remelem)
* last = elem + 1
*/
__pyx_t_9 = __pyx_v_elem;
for (__pyx_v_remelem = __pyx_v_last; __pyx_v_remelem < __pyx_t_9; __pyx_v_remelem++) {
/* "lib/intbitset.pyx":227
* raise OverflowError("Elements must be <= %s" % maxelem)
* for remelem from last <= remelem < elem:
* intBitSetDelElem(self.bitset, remelem) # <<<<<<<<<<<<<<
* last = elem + 1
* else:
*/
intBitSetDelElem(__pyx_v_self->bitset, __pyx_v_remelem);
}
/* "lib/intbitset.pyx":228
* for remelem from last <= remelem < elem:
* intBitSetDelElem(self.bitset, remelem)
* last = elem + 1 # <<<<<<<<<<<<<<
* else:
* if tuple_of_tuples:
*/
__pyx_v_last = (__pyx_v_elem + 1);
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__pyx_L41:;
goto __pyx_L40;
}
/*else*/ {
/* "lib/intbitset.pyx":230
* last = elem + 1
* else:
* if tuple_of_tuples: # <<<<<<<<<<<<<<
* for tmp_tuple in rhs:
* elem = tmp_tuple[0]
*/
if (__pyx_v_tuple_of_tuples) {
/* "lib/intbitset.pyx":231
* else:
* if tuple_of_tuples:
* for tmp_tuple in rhs: # <<<<<<<<<<<<<<
* elem = tmp_tuple[0]
* for remelem from last <= remelem < elem:
*/
if (PyList_CheckExact(__pyx_v_rhs) || PyTuple_CheckExact(__pyx_v_rhs)) {
__pyx_t_4 = __pyx_v_rhs; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0;
__pyx_t_17 = NULL;
} else {
__pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
for (;;) {
if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break;
__pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++;
} else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
__pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++;
} else {
__pyx_t_10 = __pyx_t_17(__pyx_t_4);
if (unlikely(!__pyx_t_10)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_10);
}
__Pyx_XDECREF(__pyx_v_tmp_tuple);
__pyx_v_tmp_tuple = __pyx_t_10;
__pyx_t_10 = 0;
/* "lib/intbitset.pyx":232
* if tuple_of_tuples:
* for tmp_tuple in rhs:
* elem = tmp_tuple[0] # <<<<<<<<<<<<<<
* for remelem from last <= remelem < elem:
* intBitSetDelElem(self.bitset, remelem)
*/
__pyx_t_10 = __Pyx_GetItemInt(__pyx_v_tmp_tuple, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_v_elem = __pyx_t_9;
/* "lib/intbitset.pyx":233
* for tmp_tuple in rhs:
* elem = tmp_tuple[0]
* for remelem from last <= remelem < elem: # <<<<<<<<<<<<<<
* intBitSetDelElem(self.bitset, remelem)
* last = elem + 1
*/
__pyx_t_9 = __pyx_v_elem;
for (__pyx_v_remelem = __pyx_v_last; __pyx_v_remelem < __pyx_t_9; __pyx_v_remelem++) {
/* "lib/intbitset.pyx":234
* elem = tmp_tuple[0]
* for remelem from last <= remelem < elem:
* intBitSetDelElem(self.bitset, remelem) # <<<<<<<<<<<<<<
* last = elem + 1
* else:
*/
intBitSetDelElem(__pyx_v_self->bitset, __pyx_v_remelem);
}
/* "lib/intbitset.pyx":235
* for remelem from last <= remelem < elem:
* intBitSetDelElem(self.bitset, remelem)
* last = elem + 1 # <<<<<<<<<<<<<<
* else:
* for elem in rhs:
*/
__pyx_v_last = (__pyx_v_elem + 1);
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L52;
}
/*else*/ {
/* "lib/intbitset.pyx":237
* last = elem + 1
* else:
* for elem in rhs: # <<<<<<<<<<<<<<
* for remelem from last <= remelem < elem:
* intBitSetDelElem(self.bitset, remelem)
*/
if (PyList_CheckExact(__pyx_v_rhs) || PyTuple_CheckExact(__pyx_v_rhs)) {
__pyx_t_4 = __pyx_v_rhs; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0;
__pyx_t_17 = NULL;
} else {
__pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
for (;;) {
if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break;
__pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++;
} else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
__pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++;
} else {
__pyx_t_10 = __pyx_t_17(__pyx_t_4);
if (unlikely(!__pyx_t_10)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_10);
}
__pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_v_elem = __pyx_t_9;
/* "lib/intbitset.pyx":238
* else:
* for elem in rhs:
* for remelem from last <= remelem < elem: # <<<<<<<<<<<<<<
* intBitSetDelElem(self.bitset, remelem)
* last = elem + 1
*/
__pyx_t_9 = __pyx_v_elem;
for (__pyx_v_remelem = __pyx_v_last; __pyx_v_remelem < __pyx_t_9; __pyx_v_remelem++) {
/* "lib/intbitset.pyx":239
* for elem in rhs:
* for remelem from last <= remelem < elem:
* intBitSetDelElem(self.bitset, remelem) # <<<<<<<<<<<<<<
* last = elem + 1
*
*/
intBitSetDelElem(__pyx_v_self->bitset, __pyx_v_remelem);
}
/* "lib/intbitset.pyx":240
* for remelem from last <= remelem < elem:
* intBitSetDelElem(self.bitset, remelem)
* last = elem + 1 # <<<<<<<<<<<<<<
*
* else:
*/
__pyx_v_last = (__pyx_v_elem + 1);
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__pyx_L52:;
}
__pyx_L40:;
goto __pyx_L39;
}
/*else*/ {
/* "lib/intbitset.pyx":243
*
* else:
* if self.sanity_checks: # <<<<<<<<<<<<<<
* if tuple_of_tuples:
* for tmp_tuple in rhs:
*/
if (__pyx_v_self->sanity_checks) {
/* "lib/intbitset.pyx":244
* else:
* if self.sanity_checks:
* if tuple_of_tuples: # <<<<<<<<<<<<<<
* for tmp_tuple in rhs:
* elem = tmp_tuple[0]
*/
if (__pyx_v_tuple_of_tuples) {
/* "lib/intbitset.pyx":245
* if self.sanity_checks:
* if tuple_of_tuples:
* for tmp_tuple in rhs: # <<<<<<<<<<<<<<
* elem = tmp_tuple[0]
* if elem < 0:
*/
if (PyList_CheckExact(__pyx_v_rhs) || PyTuple_CheckExact(__pyx_v_rhs)) {
__pyx_t_4 = __pyx_v_rhs; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0;
__pyx_t_17 = NULL;
} else {
__pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
for (;;) {
if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break;
__pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++;
} else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
__pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++;
} else {
__pyx_t_10 = __pyx_t_17(__pyx_t_4);
if (unlikely(!__pyx_t_10)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_10);
}
__Pyx_XDECREF(__pyx_v_tmp_tuple);
__pyx_v_tmp_tuple = __pyx_t_10;
__pyx_t_10 = 0;
/* "lib/intbitset.pyx":246
* if tuple_of_tuples:
* for tmp_tuple in rhs:
* elem = tmp_tuple[0] # <<<<<<<<<<<<<<
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
*/
__pyx_t_10 = __Pyx_GetItemInt(__pyx_v_tmp_tuple, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_v_elem = __pyx_t_9;
/* "lib/intbitset.pyx":247
* for tmp_tuple in rhs:
* elem = tmp_tuple[0]
* if elem < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
*/
__pyx_t_6 = (__pyx_v_elem < 0);
if (__pyx_t_6) {
/* "lib/intbitset.pyx":248
* elem = tmp_tuple[0]
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_Raise(__pyx_t_10, 0, 0, 0);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
goto __pyx_L65;
}
/* "lib/intbitset.pyx":249
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("Elements must be <= %s" % maxelem)
* intBitSetAddElem(self.bitset, elem)
*/
__pyx_t_6 = (__pyx_v_elem > maxelem);
if (__pyx_t_6) {
/* "lib/intbitset.pyx":250
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* intBitSetAddElem(self.bitset, elem)
* else:
*/
__pyx_t_10 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_5));
__Pyx_GIVEREF(((PyObject *)__pyx_t_5));
__pyx_t_5 = 0;
__pyx_t_5 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 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 = 250; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
goto __pyx_L65;
}
__pyx_L65:;
/* "lib/intbitset.pyx":251
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
* intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<<
* else:
* for elem in rhs:
*/
intBitSetAddElem(__pyx_v_self->bitset, __pyx_v_elem);
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L62;
}
/*else*/ {
/* "lib/intbitset.pyx":253
* intBitSetAddElem(self.bitset, elem)
* else:
* for elem in rhs: # <<<<<<<<<<<<<<
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
*/
if (PyList_CheckExact(__pyx_v_rhs) || PyTuple_CheckExact(__pyx_v_rhs)) {
__pyx_t_4 = __pyx_v_rhs; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0;
__pyx_t_17 = NULL;
} else {
__pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
for (;;) {
if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break;
__pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++;
} else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++;
} else {
__pyx_t_5 = __pyx_t_17(__pyx_t_4);
if (unlikely(!__pyx_t_5)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_elem = __pyx_t_9;
/* "lib/intbitset.pyx":254
* else:
* for elem in rhs:
* if elem < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
*/
__pyx_t_6 = (__pyx_v_elem < 0);
if (__pyx_t_6) {
/* "lib/intbitset.pyx":255
* for elem in rhs:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
goto __pyx_L68;
}
/* "lib/intbitset.pyx":256
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("Elements must be <= %s" % maxelem)
* intBitSetAddElem(self.bitset, elem)
*/
__pyx_t_6 = (__pyx_v_elem > maxelem);
if (__pyx_t_6) {
/* "lib/intbitset.pyx":257
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* intBitSetAddElem(self.bitset, elem)
* else:
*/
__pyx_t_5 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_10));
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_10));
__Pyx_GIVEREF(((PyObject *)__pyx_t_10));
__pyx_t_10 = 0;
__pyx_t_10 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_10, 0, 0, 0);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
goto __pyx_L68;
}
__pyx_L68:;
/* "lib/intbitset.pyx":258
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
* intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<<
* else:
* if tuple_of_tuples:
*/
intBitSetAddElem(__pyx_v_self->bitset, __pyx_v_elem);
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__pyx_L62:;
goto __pyx_L61;
}
/*else*/ {
/* "lib/intbitset.pyx":260
* intBitSetAddElem(self.bitset, elem)
* else:
* if tuple_of_tuples: # <<<<<<<<<<<<<<
* for tmp_tuple in rhs:
* elem = tmp_tuple[0]
*/
if (__pyx_v_tuple_of_tuples) {
/* "lib/intbitset.pyx":261
* else:
* if tuple_of_tuples:
* for tmp_tuple in rhs: # <<<<<<<<<<<<<<
* elem = tmp_tuple[0]
* intBitSetAddElem(self.bitset, elem)
*/
if (PyList_CheckExact(__pyx_v_rhs) || PyTuple_CheckExact(__pyx_v_rhs)) {
__pyx_t_4 = __pyx_v_rhs; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0;
__pyx_t_17 = NULL;
} else {
__pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
for (;;) {
if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break;
__pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++;
} else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
__pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++;
} else {
__pyx_t_10 = __pyx_t_17(__pyx_t_4);
if (unlikely(!__pyx_t_10)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_10);
}
__Pyx_XDECREF(__pyx_v_tmp_tuple);
__pyx_v_tmp_tuple = __pyx_t_10;
__pyx_t_10 = 0;
/* "lib/intbitset.pyx":262
* if tuple_of_tuples:
* for tmp_tuple in rhs:
* elem = tmp_tuple[0] # <<<<<<<<<<<<<<
* intBitSetAddElem(self.bitset, elem)
* else:
*/
__pyx_t_10 = __Pyx_GetItemInt(__pyx_v_tmp_tuple, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_v_elem = __pyx_t_9;
/* "lib/intbitset.pyx":263
* for tmp_tuple in rhs:
* elem = tmp_tuple[0]
* intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<<
* else:
* for elem in rhs:
*/
intBitSetAddElem(__pyx_v_self->bitset, __pyx_v_elem);
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L69;
}
/*else*/ {
/* "lib/intbitset.pyx":265
* intBitSetAddElem(self.bitset, elem)
* else:
* for elem in rhs: # <<<<<<<<<<<<<<
* intBitSetAddElem(self.bitset, elem)
* except Exception, msg:
*/
if (PyList_CheckExact(__pyx_v_rhs) || PyTuple_CheckExact(__pyx_v_rhs)) {
__pyx_t_4 = __pyx_v_rhs; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0;
__pyx_t_17 = NULL;
} else {
__pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
for (;;) {
if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break;
__pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++;
} else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
__pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++;
} else {
__pyx_t_10 = __pyx_t_17(__pyx_t_4);
if (unlikely(!__pyx_t_10)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_10);
}
__pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_v_elem = __pyx_t_9;
/* "lib/intbitset.pyx":266
* else:
* for elem in rhs:
* intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<<
* except Exception, msg:
* raise ValueError("retrieving integers from rhs is impossible: %s" % msg)
*/
intBitSetAddElem(__pyx_v_self->bitset, __pyx_v_elem);
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__pyx_L69:;
}
__pyx_L61:;
}
__pyx_L39:;
}
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
goto __pyx_L34_try_end;
__pyx_L27_error:;
__Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "lib/intbitset.pyx":267
* for elem in rhs:
* intBitSetAddElem(self.bitset, elem)
* except Exception, msg: # <<<<<<<<<<<<<<
* raise ValueError("retrieving integers from rhs is impossible: %s" % msg)
* else:
*/
__pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
if (__pyx_t_9) {
__Pyx_AddTraceback("lib.intbitset.intbitset.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_10);
__Pyx_DECREF(__pyx_v_msg);
__pyx_v_msg = __pyx_t_10;
/* "lib/intbitset.pyx":268
* intBitSetAddElem(self.bitset, elem)
* except Exception, msg:
* raise ValueError("retrieving integers from rhs is impossible: %s" % msg) # <<<<<<<<<<<<<<
* else:
* raise TypeError("rhs is of unknown type %s" % type(rhs))
*/
__pyx_t_15 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_14), __pyx_v_msg); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_15));
__pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
__Pyx_GOTREF(__pyx_t_16);
PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)__pyx_t_15));
__Pyx_GIVEREF(((PyObject *)__pyx_t_15));
__pyx_t_15 = 0;
__pyx_t_15 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
__Pyx_Raise(__pyx_t_15, 0, 0, 0);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L28_exception_handled;
}
__pyx_L29_except_error:;
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11);
goto __pyx_L3_error;
__pyx_L28_exception_handled:;
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11);
__pyx_L34_try_end:;
}
goto __pyx_L12;
}
/*else*/ {
/* "lib/intbitset.pyx":270
* raise ValueError("retrieving integers from rhs is impossible: %s" % msg)
* else:
* raise TypeError("rhs is of unknown type %s" % type(rhs)) # <<<<<<<<<<<<<<
* except:
* intBitSetDestroy(self.bitset)
*/
__pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_15), ((PyObject *)Py_TYPE(__pyx_v_rhs))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
__pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_5));
__Pyx_GIVEREF(((PyObject *)__pyx_t_5));
__pyx_t_5 = 0;
__pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 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 = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
__pyx_L12:;
}
__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_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_L3_error:;
__Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "lib/intbitset.pyx":271
* else:
* raise TypeError("rhs is of unknown type %s" % type(rhs))
* except: # <<<<<<<<<<<<<<
* intBitSetDestroy(self.bitset)
* raise
*/
/*except:*/ {
__Pyx_AddTraceback("lib.intbitset.intbitset.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_10, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GOTREF(__pyx_t_4);
/* "lib/intbitset.pyx":272
* raise TypeError("rhs is of unknown type %s" % type(rhs))
* except:
* intBitSetDestroy(self.bitset) # <<<<<<<<<<<<<<
* raise
*
*/
intBitSetDestroy(__pyx_v_self->bitset);
/* "lib/intbitset.pyx":273
* except:
* intBitSetDestroy(self.bitset)
* raise # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
__Pyx_GIVEREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_ErrRestore(__pyx_t_5, __pyx_t_10, __pyx_t_4);
__pyx_t_5 = 0; __pyx_t_10 = 0; __pyx_t_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L4_exception_handled;
}
__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_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_L10_try_end:;
}
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_AddTraceback("lib.intbitset.intbitset.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_msg);
__Pyx_XDECREF(__pyx_v_tmp);
__Pyx_XDECREF(__pyx_v_tmp_tuple);
__Pyx_XDECREF(__pyx_v_rhs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static void __pyx_pw_3lib_9intbitset_9intbitset_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_3lib_9intbitset_9intbitset_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__pyx_pf_3lib_9intbitset_9intbitset_2__dealloc__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
}
/* "lib/intbitset.pyx":275
* raise
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* #print >> sys.stderr, "intbitset.__dealloc__ is called"
* intBitSetDestroy(self.bitset)
*/
static void __pyx_pf_3lib_9intbitset_9intbitset_2__dealloc__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "lib/intbitset.pyx":277
* def __dealloc__(self):
* #print >> sys.stderr, "intbitset.__dealloc__ is called"
* intBitSetDestroy(self.bitset) # <<<<<<<<<<<<<<
*
* def __contains__(self, int elem):
*/
intBitSetDestroy(__pyx_v_self->bitset);
__Pyx_RefNannyFinishContext();
}
/* Python wrapper */
static int __pyx_pw_3lib_9intbitset_9intbitset_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem); /*proto*/
static int __pyx_pw_3lib_9intbitset_9intbitset_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem) {
int __pyx_v_elem;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
assert(__pyx_arg_elem); {
__pyx_v_elem = __Pyx_PyInt_AsInt(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_AddTraceback("lib.intbitset.intbitset.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_4__contains__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((int)__pyx_v_elem));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":279
* intBitSetDestroy(self.bitset)
*
* def __contains__(self, int elem): # <<<<<<<<<<<<<<
* if self.sanity_checks:
* if elem < 0:
*/
static int __pyx_pf_3lib_9intbitset_9intbitset_4__contains__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, int __pyx_v_elem) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__contains__", 0);
/* "lib/intbitset.pyx":280
*
* def __contains__(self, int elem):
* if self.sanity_checks: # <<<<<<<<<<<<<<
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
*/
if (__pyx_v_self->sanity_checks) {
/* "lib/intbitset.pyx":281
* def __contains__(self, int elem):
* if self.sanity_checks:
* if elem < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
*/
__pyx_t_1 = (__pyx_v_elem < 0);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":282
* if self.sanity_checks:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem)
*/
__pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_16), NULL); 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_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
/* "lib/intbitset.pyx":283
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("Element must be <= %s" % maxelem)
* return intBitSetIsInElem(self.bitset, elem) != 0
*/
__pyx_t_1 = (__pyx_v_elem > maxelem);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":284
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* return intBitSetIsInElem(self.bitset, elem) != 0
*
*/
__pyx_t_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __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 = 284; __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_OverflowError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __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 = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
__pyx_L4:;
goto __pyx_L3;
}
__pyx_L3:;
/* "lib/intbitset.pyx":285
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem)
* return intBitSetIsInElem(self.bitset, elem) != 0 # <<<<<<<<<<<<<<
*
* def __cmp__(self, intbitset rhs not None):
*/
__pyx_r = (intBitSetIsInElem(__pyx_v_self->bitset, __pyx_v_elem) != 0);
goto __pyx_L0;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("lib.intbitset.intbitset.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
#if PY_MAJOR_VERSION < 3
static int __pyx_pw_3lib_9intbitset_9intbitset_7__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/
static int __pyx_pw_3lib_9intbitset_9intbitset_7__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cmp__ (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_3lib_9intbitset_intbitset, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_6__cmp__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_rhs));
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
/* "lib/intbitset.pyx":287
* return intBitSetIsInElem(self.bitset, elem) != 0
*
* def __cmp__(self, intbitset rhs not None): # <<<<<<<<<<<<<<
* raise TypeError("cannot compare intbitset using cmp()")
*
*/
#if PY_MAJOR_VERSION < 3
static int __pyx_pf_3lib_9intbitset_9intbitset_6__cmp__(CYTHON_UNUSED struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs) {
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("__cmp__", 0);
/* "lib/intbitset.pyx":288
*
* def __cmp__(self, intbitset rhs not None):
* raise TypeError("cannot compare intbitset using cmp()") # <<<<<<<<<<<<<<
*
* def __richcmp__(self, intbitset rhs not None, int op):
*/
__pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("lib.intbitset.intbitset.__cmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_9__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_9__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs, int __pyx_v_op) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_3lib_9intbitset_intbitset, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_8__richcmp__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_rhs), ((int)__pyx_v_op));
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":290
* raise TypeError("cannot compare intbitset using cmp()")
*
* def __richcmp__(self, intbitset rhs not None, int op): # <<<<<<<<<<<<<<
* cdef short unsigned int tmp
* tmp = intBitSetCmp((<intbitset>self).bitset, rhs.bitset)
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_8__richcmp__(PyObject *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs, int __pyx_v_op) {
unsigned short __pyx_v_tmp;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
unsigned short __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__richcmp__", 0);
/* "lib/intbitset.pyx":292
* def __richcmp__(self, intbitset rhs not None, int op):
* cdef short unsigned int tmp
* tmp = intBitSetCmp((<intbitset>self).bitset, rhs.bitset) # <<<<<<<<<<<<<<
* if op == 0: # <
* return tmp == 1
*/
__pyx_v_tmp = intBitSetCmp(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_rhs->bitset);
/* "lib/intbitset.pyx":293
* cdef short unsigned int tmp
* tmp = intBitSetCmp((<intbitset>self).bitset, rhs.bitset)
* if op == 0: # < # <<<<<<<<<<<<<<
* return tmp == 1
* if op == 1: # <=
*/
__pyx_t_1 = (__pyx_v_op == 0);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":294
* tmp = intBitSetCmp((<intbitset>self).bitset, rhs.bitset)
* if op == 0: # <
* return tmp == 1 # <<<<<<<<<<<<<<
* if op == 1: # <=
* return tmp <= 1
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp == 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
goto __pyx_L3;
}
__pyx_L3:;
/* "lib/intbitset.pyx":295
* if op == 0: # <
* return tmp == 1
* if op == 1: # <= # <<<<<<<<<<<<<<
* return tmp <= 1
* if op == 2: # ==
*/
__pyx_t_1 = (__pyx_v_op == 1);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":296
* return tmp == 1
* if op == 1: # <=
* return tmp <= 1 # <<<<<<<<<<<<<<
* if op == 2: # ==
* return tmp == 0
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp <= 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
goto __pyx_L4;
}
__pyx_L4:;
/* "lib/intbitset.pyx":297
* if op == 1: # <=
* return tmp <= 1
* if op == 2: # == # <<<<<<<<<<<<<<
* return tmp == 0
* if op == 3: # !=
*/
__pyx_t_1 = (__pyx_v_op == 2);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":298
* return tmp <= 1
* if op == 2: # ==
* return tmp == 0 # <<<<<<<<<<<<<<
* if op == 3: # !=
* return tmp > 0
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp == 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
goto __pyx_L5;
}
__pyx_L5:;
/* "lib/intbitset.pyx":299
* if op == 2: # ==
* return tmp == 0
* if op == 3: # != # <<<<<<<<<<<<<<
* return tmp > 0
* if op == 4: # >
*/
__pyx_t_1 = (__pyx_v_op == 3);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":300
* return tmp == 0
* if op == 3: # !=
* return tmp > 0 # <<<<<<<<<<<<<<
* if op == 4: # >
* return tmp == 2
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp > 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
goto __pyx_L6;
}
__pyx_L6:;
/* "lib/intbitset.pyx":301
* if op == 3: # !=
* return tmp > 0
* if op == 4: # > # <<<<<<<<<<<<<<
* return tmp == 2
* if op == 5: # >=
*/
__pyx_t_1 = (__pyx_v_op == 4);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":302
* return tmp > 0
* if op == 4: # >
* return tmp == 2 # <<<<<<<<<<<<<<
* if op == 5: # >=
* return tmp in (0, 2)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp == 2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
goto __pyx_L7;
}
__pyx_L7:;
/* "lib/intbitset.pyx":303
* if op == 4: # >
* return tmp == 2
* if op == 5: # >= # <<<<<<<<<<<<<<
* return tmp in (0, 2)
*
*/
__pyx_t_1 = (__pyx_v_op == 5);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":304
* return tmp == 2
* if op == 5: # >=
* return tmp in (0, 2) # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_v_tmp;
switch (__pyx_v_tmp) {
case 0:
case 2:
__pyx_t_1 = 1;
break;
default:
__pyx_t_1 = 0;
break;
}
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
goto __pyx_L8;
}
__pyx_L8:;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("lib.intbitset.intbitset.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static Py_ssize_t __pyx_pw_3lib_9intbitset_9intbitset_11__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_3lib_9intbitset_9intbitset_11__len__(PyObject *__pyx_v_self) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_10__len__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":306
* return tmp in (0, 2)
*
* def __len__(self): # <<<<<<<<<<<<<<
* return intBitSetGetTot(self.bitset)
*
*/
static Py_ssize_t __pyx_pf_3lib_9intbitset_9intbitset_10__len__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
/* "lib/intbitset.pyx":307
*
* def __len__(self):
* return intBitSetGetTot(self.bitset) # <<<<<<<<<<<<<<
*
* def __hash__(self):
*/
__pyx_r = intBitSetGetTot(__pyx_v_self->bitset);
goto __pyx_L0;
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static Py_hash_t __pyx_pw_3lib_9intbitset_9intbitset_13__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_3lib_9intbitset_9intbitset_13__hash__(PyObject *__pyx_v_self) {
Py_hash_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_12__hash__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":309
* return intBitSetGetTot(self.bitset)
*
* def __hash__(self): # <<<<<<<<<<<<<<
* return hash(PyString_FromStringAndSize(<char *>self.bitset.bitset, wordbytesize * (intBitSetGetTot(self.bitset) / wordbitsize + 1)))
*
*/
static Py_hash_t __pyx_pf_3lib_9intbitset_9intbitset_12__hash__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self) {
Py_hash_t __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_hash_t __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__hash__", 0);
/* "lib/intbitset.pyx":310
*
* def __hash__(self):
* return hash(PyString_FromStringAndSize(<char *>self.bitset.bitset, wordbytesize * (intBitSetGetTot(self.bitset) / wordbitsize + 1))) # <<<<<<<<<<<<<<
*
* def __nonzero__(self):
*/
__pyx_t_1 = intBitSetGetTot(__pyx_v_self->bitset);
if (unlikely(wordbitsize == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
else if (sizeof(int) == sizeof(long) && unlikely(wordbitsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_1))) {
PyErr_Format(PyExc_OverflowError, "value too large to perform division");
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_2 = PyString_FromStringAndSize(((char *)__pyx_v_self->bitset->bitset), (wordbytesize * (__Pyx_div_int(__pyx_t_1, wordbitsize) + 1))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyObject_Hash(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_3;
goto __pyx_L0;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("lib.intbitset.intbitset.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_3lib_9intbitset_9intbitset_15__nonzero__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_3lib_9intbitset_9intbitset_15__nonzero__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_14__nonzero__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":312
* return hash(PyString_FromStringAndSize(<char *>self.bitset.bitset, wordbytesize * (intBitSetGetTot(self.bitset) / wordbitsize + 1)))
*
* def __nonzero__(self): # <<<<<<<<<<<<<<
* return not intBitSetEmpty(self.bitset)
*
*/
static int __pyx_pf_3lib_9intbitset_9intbitset_14__nonzero__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__nonzero__", 0);
/* "lib/intbitset.pyx":313
*
* def __nonzero__(self):
* return not intBitSetEmpty(self.bitset) # <<<<<<<<<<<<<<
*
* def __iadd__(self, rhs):
*/
__pyx_r = (!intBitSetEmpty(__pyx_v_self->bitset));
goto __pyx_L0;
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_17__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_17__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_16__iadd__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":315
* return not intBitSetEmpty(self.bitset)
*
* def __iadd__(self, rhs): # <<<<<<<<<<<<<<
* cdef int elem
* if isinstance(rhs, (int, long)):
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_16__iadd__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_rhs) {
int __pyx_v_elem;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
unsigned int __pyx_t_6;
Py_ssize_t __pyx_t_7;
PyObject *(*__pyx_t_8)(PyObject *);
int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__iadd__", 0);
/* "lib/intbitset.pyx":317
* def __iadd__(self, rhs):
* cdef int elem
* if isinstance(rhs, (int, long)): # <<<<<<<<<<<<<<
* if self.sanity_checks:
* if rhs < 0:
*/
__Pyx_INCREF(__pyx_v_rhs);
__pyx_t_1 = __pyx_v_rhs;
__pyx_t_2 = PyInt_Check(__pyx_t_1);
if (!__pyx_t_2) {
__pyx_t_3 = PyLong_Check(__pyx_t_1);
__pyx_t_4 = __pyx_t_3;
} else {
__pyx_t_4 = __pyx_t_2;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
/* "lib/intbitset.pyx":318
* cdef int elem
* if isinstance(rhs, (int, long)):
* if self.sanity_checks: # <<<<<<<<<<<<<<
* if rhs < 0:
* raise ValueError("Negative numbers, not allowed")
*/
if (__pyx_v_self->sanity_checks) {
/* "lib/intbitset.pyx":319
* if isinstance(rhs, (int, long)):
* if self.sanity_checks:
* if rhs < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif rhs > maxelem:
*/
__pyx_t_1 = PyObject_RichCompare(__pyx_v_rhs, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
/* "lib/intbitset.pyx":320
* if self.sanity_checks:
* if rhs < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif rhs > maxelem:
* raise OverflowError("rhs must be <= %s" % maxelem)
*/
__pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L5;
}
/* "lib/intbitset.pyx":321
* if rhs < 0:
* raise ValueError("Negative numbers, not allowed")
* elif rhs > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("rhs must be <= %s" % maxelem)
* intBitSetAddElem(self.bitset, rhs)
*/
__pyx_t_1 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PyObject_RichCompare(__pyx_v_rhs, __pyx_t_1, Py_GT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_4) {
/* "lib/intbitset.pyx":322
* raise ValueError("Negative numbers, not allowed")
* elif rhs > maxelem:
* raise OverflowError("rhs must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* intBitSetAddElem(self.bitset, rhs)
* elif isinstance(rhs, intbitset):
*/
__pyx_t_5 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__pyx_t_1 = 0;
__pyx_t_1 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L5;
}
__pyx_L5:;
goto __pyx_L4;
}
__pyx_L4:;
/* "lib/intbitset.pyx":323
* elif rhs > maxelem:
* raise OverflowError("rhs must be <= %s" % maxelem)
* intBitSetAddElem(self.bitset, rhs) # <<<<<<<<<<<<<<
* elif isinstance(rhs, intbitset):
* intBitSetIUnion(self.bitset, (<intbitset> rhs).bitset)
*/
__pyx_t_6 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_rhs); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
intBitSetAddElem(__pyx_v_self->bitset, __pyx_t_6);
goto __pyx_L3;
}
/* "lib/intbitset.pyx":324
* raise OverflowError("rhs must be <= %s" % maxelem)
* intBitSetAddElem(self.bitset, rhs)
* elif isinstance(rhs, intbitset): # <<<<<<<<<<<<<<
* intBitSetIUnion(self.bitset, (<intbitset> rhs).bitset)
* else:
*/
__pyx_t_1 = ((PyObject *)((PyObject*)__pyx_ptype_3lib_9intbitset_intbitset));
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __Pyx_TypeCheck(__pyx_v_rhs, __pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
/* "lib/intbitset.pyx":325
* intBitSetAddElem(self.bitset, rhs)
* elif isinstance(rhs, intbitset):
* intBitSetIUnion(self.bitset, (<intbitset> rhs).bitset) # <<<<<<<<<<<<<<
* else:
* if self.sanity_checks:
*/
intBitSetIUnion(__pyx_v_self->bitset, ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_rhs)->bitset);
goto __pyx_L3;
}
/*else*/ {
/* "lib/intbitset.pyx":327
* intBitSetIUnion(self.bitset, (<intbitset> rhs).bitset)
* else:
* if self.sanity_checks: # <<<<<<<<<<<<<<
* for elem in rhs:
* if elem < 0:
*/
if (__pyx_v_self->sanity_checks) {
/* "lib/intbitset.pyx":328
* else:
* if self.sanity_checks:
* for elem in rhs: # <<<<<<<<<<<<<<
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
*/
if (PyList_CheckExact(__pyx_v_rhs) || PyTuple_CheckExact(__pyx_v_rhs)) {
__pyx_t_1 = __pyx_v_rhs; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
__pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
for (;;) {
if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
__pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++;
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++;
} else {
__pyx_t_5 = __pyx_t_8(__pyx_t_1);
if (unlikely(!__pyx_t_5)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_elem = __pyx_t_9;
/* "lib/intbitset.pyx":329
* if self.sanity_checks:
* for elem in rhs:
* if elem < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
*/
__pyx_t_4 = (__pyx_v_elem < 0);
if (__pyx_t_4) {
/* "lib/intbitset.pyx":330
* for elem in rhs:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L9;
}
/* "lib/intbitset.pyx":331
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("Elements must be <= %s" % maxelem)
* intBitSetAddElem(self.bitset, elem)
*/
__pyx_t_4 = (__pyx_v_elem > maxelem);
if (__pyx_t_4) {
/* "lib/intbitset.pyx":332
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* intBitSetAddElem(self.bitset, elem)
* else:
*/
__pyx_t_5 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_10));
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_10));
__Pyx_GIVEREF(((PyObject *)__pyx_t_10));
__pyx_t_10 = 0;
__pyx_t_10 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_10, 0, 0, 0);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L9;
}
__pyx_L9:;
/* "lib/intbitset.pyx":333
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
* intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<<
* else:
* for elem in rhs:
*/
intBitSetAddElem(__pyx_v_self->bitset, __pyx_v_elem);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L6;
}
/*else*/ {
/* "lib/intbitset.pyx":335
* intBitSetAddElem(self.bitset, elem)
* else:
* for elem in rhs: # <<<<<<<<<<<<<<
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
*/
if (PyList_CheckExact(__pyx_v_rhs) || PyTuple_CheckExact(__pyx_v_rhs)) {
__pyx_t_1 = __pyx_v_rhs; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
__pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
for (;;) {
if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
__pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++;
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
__pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++;
} else {
__pyx_t_10 = __pyx_t_8(__pyx_t_1);
if (unlikely(!__pyx_t_10)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_10);
}
__pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_v_elem = __pyx_t_9;
/* "lib/intbitset.pyx":336
* else:
* for elem in rhs:
* if elem < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
*/
__pyx_t_4 = (__pyx_v_elem < 0);
if (__pyx_t_4) {
/* "lib/intbitset.pyx":337
* for elem in rhs:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_Raise(__pyx_t_10, 0, 0, 0);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L12;
}
/* "lib/intbitset.pyx":338
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("Elements must be <= %s" % maxelem)
* intBitSetAddElem(self.bitset, elem)
*/
__pyx_t_4 = (__pyx_v_elem > maxelem);
if (__pyx_t_4) {
/* "lib/intbitset.pyx":339
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* intBitSetAddElem(self.bitset, elem)
* return self
*/
__pyx_t_10 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_5));
__Pyx_GIVEREF(((PyObject *)__pyx_t_5));
__pyx_t_5 = 0;
__pyx_t_5 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 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 = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L12;
}
__pyx_L12:;
/* "lib/intbitset.pyx":340
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
* intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<<
* return self
*
*/
intBitSetAddElem(__pyx_v_self->bitset, __pyx_v_elem);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L6:;
}
__pyx_L3:;
/* "lib/intbitset.pyx":341
* raise OverflowError("Elements must be <= %s" % maxelem)
* intBitSetAddElem(self.bitset, elem)
* return self # <<<<<<<<<<<<<<
*
* def __isub__(self, rhs):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
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_5);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("lib.intbitset.intbitset.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_19__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_18__isub__[] = "Remove all elements of another set from this set.";
struct wrapperbase __pyx_wrapperbase_3lib_9intbitset_9intbitset_18__isub__;
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_19__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__isub__ (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_18__isub__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":343
* return self
*
* def __isub__(self, rhs): # <<<<<<<<<<<<<<
* """Remove all elements of another set from this set."""
* cdef int elem
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_18__isub__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_rhs) {
int __pyx_v_elem;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
unsigned int __pyx_t_6;
Py_ssize_t __pyx_t_7;
PyObject *(*__pyx_t_8)(PyObject *);
int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__isub__", 0);
/* "lib/intbitset.pyx":346
* """Remove all elements of another set from this set."""
* cdef int elem
* if isinstance(rhs, (int, long)): # <<<<<<<<<<<<<<
* if self.sanity_checks:
* if rhs < 0:
*/
__Pyx_INCREF(__pyx_v_rhs);
__pyx_t_1 = __pyx_v_rhs;
__pyx_t_2 = PyInt_Check(__pyx_t_1);
if (!__pyx_t_2) {
__pyx_t_3 = PyLong_Check(__pyx_t_1);
__pyx_t_4 = __pyx_t_3;
} else {
__pyx_t_4 = __pyx_t_2;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
/* "lib/intbitset.pyx":347
* cdef int elem
* if isinstance(rhs, (int, long)):
* if self.sanity_checks: # <<<<<<<<<<<<<<
* if rhs < 0:
* raise ValueError("Negative numbers, not allowed")
*/
if (__pyx_v_self->sanity_checks) {
/* "lib/intbitset.pyx":348
* if isinstance(rhs, (int, long)):
* if self.sanity_checks:
* if rhs < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif rhs > maxelem:
*/
__pyx_t_1 = PyObject_RichCompare(__pyx_v_rhs, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
/* "lib/intbitset.pyx":349
* if self.sanity_checks:
* if rhs < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif rhs > maxelem:
* raise OverflowError("rhs must be <= %s" % maxelem)
*/
__pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L5;
}
/* "lib/intbitset.pyx":350
* if rhs < 0:
* raise ValueError("Negative numbers, not allowed")
* elif rhs > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("rhs must be <= %s" % maxelem)
* intBitSetDelElem(self.bitset, rhs)
*/
__pyx_t_1 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PyObject_RichCompare(__pyx_v_rhs, __pyx_t_1, Py_GT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_4) {
/* "lib/intbitset.pyx":351
* raise ValueError("Negative numbers, not allowed")
* elif rhs > maxelem:
* raise OverflowError("rhs must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* intBitSetDelElem(self.bitset, rhs)
* elif isinstance(rhs, intbitset):
*/
__pyx_t_5 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__pyx_t_1 = 0;
__pyx_t_1 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L5;
}
__pyx_L5:;
goto __pyx_L4;
}
__pyx_L4:;
/* "lib/intbitset.pyx":352
* elif rhs > maxelem:
* raise OverflowError("rhs must be <= %s" % maxelem)
* intBitSetDelElem(self.bitset, rhs) # <<<<<<<<<<<<<<
* elif isinstance(rhs, intbitset):
* intBitSetISub(self.bitset, (<intbitset> rhs).bitset)
*/
__pyx_t_6 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_rhs); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
intBitSetDelElem(__pyx_v_self->bitset, __pyx_t_6);
goto __pyx_L3;
}
/* "lib/intbitset.pyx":353
* raise OverflowError("rhs must be <= %s" % maxelem)
* intBitSetDelElem(self.bitset, rhs)
* elif isinstance(rhs, intbitset): # <<<<<<<<<<<<<<
* intBitSetISub(self.bitset, (<intbitset> rhs).bitset)
* else:
*/
__pyx_t_1 = ((PyObject *)((PyObject*)__pyx_ptype_3lib_9intbitset_intbitset));
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __Pyx_TypeCheck(__pyx_v_rhs, __pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
/* "lib/intbitset.pyx":354
* intBitSetDelElem(self.bitset, rhs)
* elif isinstance(rhs, intbitset):
* intBitSetISub(self.bitset, (<intbitset> rhs).bitset) # <<<<<<<<<<<<<<
* else:
* if self.sanity_checks:
*/
intBitSetISub(__pyx_v_self->bitset, ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_rhs)->bitset);
goto __pyx_L3;
}
/*else*/ {
/* "lib/intbitset.pyx":356
* intBitSetISub(self.bitset, (<intbitset> rhs).bitset)
* else:
* if self.sanity_checks: # <<<<<<<<<<<<<<
* for elem in rhs:
* if elem < 0:
*/
if (__pyx_v_self->sanity_checks) {
/* "lib/intbitset.pyx":357
* else:
* if self.sanity_checks:
* for elem in rhs: # <<<<<<<<<<<<<<
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
*/
if (PyList_CheckExact(__pyx_v_rhs) || PyTuple_CheckExact(__pyx_v_rhs)) {
__pyx_t_1 = __pyx_v_rhs; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
__pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
for (;;) {
if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
__pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++;
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++;
} else {
__pyx_t_5 = __pyx_t_8(__pyx_t_1);
if (unlikely(!__pyx_t_5)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_elem = __pyx_t_9;
/* "lib/intbitset.pyx":358
* if self.sanity_checks:
* for elem in rhs:
* if elem < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
*/
__pyx_t_4 = (__pyx_v_elem < 0);
if (__pyx_t_4) {
/* "lib/intbitset.pyx":359
* for elem in rhs:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_25), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L9;
}
/* "lib/intbitset.pyx":360
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("Elements must be <= %s" % maxelem)
* intBitSetDelElem(self.bitset, elem)
*/
__pyx_t_4 = (__pyx_v_elem > maxelem);
if (__pyx_t_4) {
/* "lib/intbitset.pyx":361
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* intBitSetDelElem(self.bitset, elem)
* else:
*/
__pyx_t_5 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_10));
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_10));
__Pyx_GIVEREF(((PyObject *)__pyx_t_10));
__pyx_t_10 = 0;
__pyx_t_10 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_10, 0, 0, 0);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L9;
}
__pyx_L9:;
/* "lib/intbitset.pyx":362
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
* intBitSetDelElem(self.bitset, elem) # <<<<<<<<<<<<<<
* else:
* for elem in rhs:
*/
intBitSetDelElem(__pyx_v_self->bitset, __pyx_v_elem);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L6;
}
/*else*/ {
/* "lib/intbitset.pyx":364
* intBitSetDelElem(self.bitset, elem)
* else:
* for elem in rhs: # <<<<<<<<<<<<<<
* intBitSetDelElem(self.bitset, elem)
* return self
*/
if (PyList_CheckExact(__pyx_v_rhs) || PyTuple_CheckExact(__pyx_v_rhs)) {
__pyx_t_1 = __pyx_v_rhs; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
__pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
for (;;) {
if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
__pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++;
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
__pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++;
} else {
__pyx_t_10 = __pyx_t_8(__pyx_t_1);
if (unlikely(!__pyx_t_10)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_10);
}
__pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_v_elem = __pyx_t_9;
/* "lib/intbitset.pyx":365
* else:
* for elem in rhs:
* intBitSetDelElem(self.bitset, elem) # <<<<<<<<<<<<<<
* return self
*
*/
intBitSetDelElem(__pyx_v_self->bitset, __pyx_v_elem);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L6:;
}
__pyx_L3:;
/* "lib/intbitset.pyx":366
* for elem in rhs:
* intBitSetDelElem(self.bitset, elem)
* return self # <<<<<<<<<<<<<<
*
* def __deepcopy__(self, memo):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
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_5);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("lib.intbitset.intbitset.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_21__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_21__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_20__deepcopy__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((PyObject *)__pyx_v_memo));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":368
* return self
*
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* return intbitset(self)
*
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_20__deepcopy__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_memo) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__deepcopy__", 0);
/* "lib/intbitset.pyx":369
*
* def __deepcopy__(self, memo):
* return intbitset(self) # <<<<<<<<<<<<<<
*
* def __del__(self, int elem):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
__pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3lib_9intbitset_intbitset)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__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("lib.intbitset.intbitset.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_23__del__(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_23__del__(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem) {
int __pyx_v_elem;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
assert(__pyx_arg_elem); {
__pyx_v_elem = __Pyx_PyInt_AsInt(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_AddTraceback("lib.intbitset.intbitset.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_22__del__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((int)__pyx_v_elem));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":371
* return intbitset(self)
*
* def __del__(self, int elem): # <<<<<<<<<<<<<<
* if self.sanity_checks:
* if elem < 0:
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_22__del__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, int __pyx_v_elem) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__del__", 0);
/* "lib/intbitset.pyx":372
*
* def __del__(self, int elem):
* if self.sanity_checks: # <<<<<<<<<<<<<<
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
*/
if (__pyx_v_self->sanity_checks) {
/* "lib/intbitset.pyx":373
* def __del__(self, int elem):
* if self.sanity_checks:
* if elem < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
*/
__pyx_t_1 = (__pyx_v_elem < 0);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":374
* if self.sanity_checks:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem)
*/
__pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __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 = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
/* "lib/intbitset.pyx":375
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("Element must be <= %s" % maxelem)
* intBitSetDelElem(self.bitset, elem)
*/
__pyx_t_1 = (__pyx_v_elem > maxelem);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":376
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* intBitSetDelElem(self.bitset, elem)
*
*/
__pyx_t_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __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 = 376; __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_OverflowError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __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 = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
__pyx_L4:;
goto __pyx_L3;
}
__pyx_L3:;
/* "lib/intbitset.pyx":377
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem)
* intBitSetDelElem(self.bitset, elem) # <<<<<<<<<<<<<<
*
* def __and__(self, intbitset rhs not None):
*/
intBitSetDelElem(__pyx_v_self->bitset, __pyx_v_elem);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("lib.intbitset.intbitset.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_25__and__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_24__and__[] = "Return the intersection of two intbitsets as a new set.\n (i.e. all elements that are in both intbitsets.)\n ";
struct wrapperbase __pyx_wrapperbase_3lib_9intbitset_9intbitset_24__and__;
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_25__and__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__and__ (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_3lib_9intbitset_intbitset, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_24__and__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_rhs));
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":379
* intBitSetDelElem(self.bitset, elem)
*
* def __and__(self, intbitset rhs not None): # <<<<<<<<<<<<<<
* """Return the intersection of two intbitsets as a new set.
* (i.e. all elements that are in both intbitsets.)
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_24__and__(PyObject *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs) {
struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_ret = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__and__", 0);
/* "lib/intbitset.pyx":383
* (i.e. all elements that are in both intbitsets.)
* """
* ret = intbitset(no_allocate=1) # <<<<<<<<<<<<<<
* (<intbitset>ret).bitset = intBitSetIntersection((<intbitset> self).bitset, rhs.bitset)
* return ret
*/
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__no_allocate), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3lib_9intbitset_intbitset)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_v_ret = ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_t_2);
__pyx_t_2 = 0;
/* "lib/intbitset.pyx":384
* """
* ret = intbitset(no_allocate=1)
* (<intbitset>ret).bitset = intBitSetIntersection((<intbitset> self).bitset, rhs.bitset) # <<<<<<<<<<<<<<
* return ret
*
*/
__pyx_v_ret->bitset = intBitSetIntersection(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_rhs->bitset);
/* "lib/intbitset.pyx":385
* ret = intbitset(no_allocate=1)
* (<intbitset>ret).bitset = intBitSetIntersection((<intbitset> self).bitset, rhs.bitset)
* return ret # <<<<<<<<<<<<<<
*
* def __or__(self, intbitset rhs not None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ret));
__pyx_r = ((PyObject *)__pyx_v_ret);
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("lib.intbitset.intbitset.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ret);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_27__or__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_26__or__[] = "Return the union of two intbitsets as a new set.\n (i.e. all elements that are in either intbitsets.)\n ";
struct wrapperbase __pyx_wrapperbase_3lib_9intbitset_9intbitset_26__or__;
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_27__or__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__or__ (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_3lib_9intbitset_intbitset, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_26__or__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_rhs));
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":387
* return ret
*
* def __or__(self, intbitset rhs not None): # <<<<<<<<<<<<<<
* """Return the union of two intbitsets as a new set.
* (i.e. all elements that are in either intbitsets.)
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_26__or__(PyObject *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs) {
struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_ret = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__or__", 0);
/* "lib/intbitset.pyx":391
* (i.e. all elements that are in either intbitsets.)
* """
* ret = intbitset(no_allocate=1) # <<<<<<<<<<<<<<
* (<intbitset>ret).bitset = intBitSetUnion((<intbitset> self).bitset, rhs.bitset)
* return ret
*/
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__no_allocate), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3lib_9intbitset_intbitset)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_v_ret = ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_t_2);
__pyx_t_2 = 0;
/* "lib/intbitset.pyx":392
* """
* ret = intbitset(no_allocate=1)
* (<intbitset>ret).bitset = intBitSetUnion((<intbitset> self).bitset, rhs.bitset) # <<<<<<<<<<<<<<
* return ret
*
*/
__pyx_v_ret->bitset = intBitSetUnion(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_rhs->bitset);
/* "lib/intbitset.pyx":393
* ret = intbitset(no_allocate=1)
* (<intbitset>ret).bitset = intBitSetUnion((<intbitset> self).bitset, rhs.bitset)
* return ret # <<<<<<<<<<<<<<
*
* def __xor__(self, intbitset rhs not None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ret));
__pyx_r = ((PyObject *)__pyx_v_ret);
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("lib.intbitset.intbitset.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ret);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_29__xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_28__xor__[] = "Return the symmetric difference of two sets as a new set.\n (i.e. all elements that are in exactly one of the sets.)\n ";
struct wrapperbase __pyx_wrapperbase_3lib_9intbitset_9intbitset_28__xor__;
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_29__xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__xor__ (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_3lib_9intbitset_intbitset, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_28__xor__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_rhs));
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":395
* return ret
*
* def __xor__(self, intbitset rhs not None): # <<<<<<<<<<<<<<
* """Return the symmetric difference of two sets as a new set.
* (i.e. all elements that are in exactly one of the sets.)
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_28__xor__(PyObject *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs) {
struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_ret = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__xor__", 0);
/* "lib/intbitset.pyx":399
* (i.e. all elements that are in exactly one of the sets.)
* """
* ret = intbitset(no_allocate=1) # <<<<<<<<<<<<<<
* (<intbitset>ret).bitset = intBitSetXor((<intbitset> self).bitset, rhs.bitset)
* return ret
*/
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__no_allocate), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3lib_9intbitset_intbitset)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_v_ret = ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_t_2);
__pyx_t_2 = 0;
/* "lib/intbitset.pyx":400
* """
* ret = intbitset(no_allocate=1)
* (<intbitset>ret).bitset = intBitSetXor((<intbitset> self).bitset, rhs.bitset) # <<<<<<<<<<<<<<
* return ret
*
*/
__pyx_v_ret->bitset = intBitSetXor(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_rhs->bitset);
/* "lib/intbitset.pyx":401
* ret = intbitset(no_allocate=1)
* (<intbitset>ret).bitset = intBitSetXor((<intbitset> self).bitset, rhs.bitset)
* return ret # <<<<<<<<<<<<<<
*
* def __sub__(self, intbitset rhs not None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ret));
__pyx_r = ((PyObject *)__pyx_v_ret);
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("lib.intbitset.intbitset.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ret);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_31__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_30__sub__[] = "Return the difference of two intbitsets as a new set.\n (i.e. all elements that are in this intbitset but not the other.)\n ";
struct wrapperbase __pyx_wrapperbase_3lib_9intbitset_9intbitset_30__sub__;
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_31__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__sub__ (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_3lib_9intbitset_intbitset, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_30__sub__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_rhs));
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":403
* return ret
*
* def __sub__(self, intbitset rhs not None): # <<<<<<<<<<<<<<
* """Return the difference of two intbitsets as a new set.
* (i.e. all elements that are in this intbitset but not the other.)
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_30__sub__(PyObject *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs) {
struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_ret = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__sub__", 0);
/* "lib/intbitset.pyx":407
* (i.e. all elements that are in this intbitset but not the other.)
* """
* ret = intbitset(no_allocate=1) # <<<<<<<<<<<<<<
* (<intbitset>ret).bitset = intBitSetSub((<intbitset> self).bitset, rhs.bitset)
* return ret
*/
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__no_allocate), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3lib_9intbitset_intbitset)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_v_ret = ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_t_2);
__pyx_t_2 = 0;
/* "lib/intbitset.pyx":408
* """
* ret = intbitset(no_allocate=1)
* (<intbitset>ret).bitset = intBitSetSub((<intbitset> self).bitset, rhs.bitset) # <<<<<<<<<<<<<<
* return ret
*
*/
__pyx_v_ret->bitset = intBitSetSub(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_rhs->bitset);
/* "lib/intbitset.pyx":409
* ret = intbitset(no_allocate=1)
* (<intbitset>ret).bitset = intBitSetSub((<intbitset> self).bitset, rhs.bitset)
* return ret # <<<<<<<<<<<<<<
*
* def __iand__(self, intbitset rhs not None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ret));
__pyx_r = ((PyObject *)__pyx_v_ret);
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("lib.intbitset.intbitset.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ret);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_33__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_32__iand__[] = "Update a intbitset with the intersection of itself and another.";
struct wrapperbase __pyx_wrapperbase_3lib_9intbitset_9intbitset_32__iand__;
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_33__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iand__ (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_3lib_9intbitset_intbitset, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_32__iand__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_rhs));
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":411
* return ret
*
* def __iand__(self, intbitset rhs not None): # <<<<<<<<<<<<<<
* """Update a intbitset with the intersection of itself and another."""
* intBitSetIIntersection(self.bitset, rhs.bitset)
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_32__iand__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iand__", 0);
/* "lib/intbitset.pyx":413
* def __iand__(self, intbitset rhs not None):
* """Update a intbitset with the intersection of itself and another."""
* intBitSetIIntersection(self.bitset, rhs.bitset) # <<<<<<<<<<<<<<
* return self
*
*/
intBitSetIIntersection(__pyx_v_self->bitset, __pyx_v_rhs->bitset);
/* "lib/intbitset.pyx":414
* """Update a intbitset with the intersection of itself and another."""
* intBitSetIIntersection(self.bitset, rhs.bitset)
* return self # <<<<<<<<<<<<<<
*
* def __ior__(self, intbitset rhs not None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_35__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_34__ior__[] = "Update a intbitset with the union of itself and another.";
struct wrapperbase __pyx_wrapperbase_3lib_9intbitset_9intbitset_34__ior__;
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_35__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__ior__ (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_3lib_9intbitset_intbitset, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_34__ior__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_rhs));
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":416
* return self
*
* def __ior__(self, intbitset rhs not None): # <<<<<<<<<<<<<<
* """Update a intbitset with the union of itself and another."""
* intBitSetIUnion(self.bitset, rhs.bitset)
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_34__ior__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__ior__", 0);
/* "lib/intbitset.pyx":418
* def __ior__(self, intbitset rhs not None):
* """Update a intbitset with the union of itself and another."""
* intBitSetIUnion(self.bitset, rhs.bitset) # <<<<<<<<<<<<<<
* return self
*
*/
intBitSetIUnion(__pyx_v_self->bitset, __pyx_v_rhs->bitset);
/* "lib/intbitset.pyx":419
* """Update a intbitset with the union of itself and another."""
* intBitSetIUnion(self.bitset, rhs.bitset)
* return self # <<<<<<<<<<<<<<
*
* def __ixor__(self, intbitset rhs not None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_37__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_36__ixor__[] = "Update an intbitset with the symmetric difference of itself and another.\n ";
struct wrapperbase __pyx_wrapperbase_3lib_9intbitset_9intbitset_36__ixor__;
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_37__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__ixor__ (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_3lib_9intbitset_intbitset, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_36__ixor__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_rhs));
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":421
* return self
*
* def __ixor__(self, intbitset rhs not None): # <<<<<<<<<<<<<<
* """Update an intbitset with the symmetric difference of itself and another.
* """
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_36__ixor__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_rhs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__ixor__", 0);
/* "lib/intbitset.pyx":424
* """Update an intbitset with the symmetric difference of itself and another.
* """
* intBitSetIXor(self.bitset, rhs.bitset) # <<<<<<<<<<<<<<
* return self
*
*/
intBitSetIXor(__pyx_v_self->bitset, __pyx_v_rhs->bitset);
/* "lib/intbitset.pyx":425
* """
* intBitSetIXor(self.bitset, rhs.bitset)
* return self # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_39__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_39__repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_38__repr__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":427
* return self
*
* def __repr__(self): # <<<<<<<<<<<<<<
* cdef int last
* cdef int maxelem
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_38__repr__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self) {
PyObject *__pyx_v_finite_list = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
/* "lib/intbitset.pyx":431
* cdef int maxelem
* cdef int next_last
* finite_list = self.extract_finite_list() # <<<<<<<<<<<<<<
* if self.bitset.trailing_bits:
* return "intbitset(%s, trailing_bits=True)" % repr(finite_list)
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__extract_finite_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __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 = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_finite_list = __pyx_t_2;
__pyx_t_2 = 0;
/* "lib/intbitset.pyx":432
* cdef int next_last
* finite_list = self.extract_finite_list()
* if self.bitset.trailing_bits: # <<<<<<<<<<<<<<
* return "intbitset(%s, trailing_bits=True)" % repr(finite_list)
* else:
*/
if (__pyx_v_self->bitset->trailing_bits) {
/* "lib/intbitset.pyx":433
* finite_list = self.extract_finite_list()
* if self.bitset.trailing_bits:
* return "intbitset(%s, trailing_bits=True)" % repr(finite_list) # <<<<<<<<<<<<<<
* else:
* return "intbitset(%s)" % repr(finite_list)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = PyObject_Repr(__pyx_v_finite_list); 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_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_27), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
goto __pyx_L3;
}
/*else*/ {
/* "lib/intbitset.pyx":435
* return "intbitset(%s, trailing_bits=True)" % repr(finite_list)
* else:
* return "intbitset(%s)" % repr(finite_list) # <<<<<<<<<<<<<<
*
* def __str__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyObject_Repr(__pyx_v_finite_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_28), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = ((PyObject *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
}
__pyx_L3:;
__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("lib.intbitset.intbitset.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_finite_list);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_41__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_41__str__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_40__str__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":437
* return "intbitset(%s)" % repr(finite_list)
*
* def __str__(self): # <<<<<<<<<<<<<<
* cdef int tot
* tot = intBitSetGetTot(self.bitset)
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_40__str__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self) {
int __pyx_v_tot;
PyObject *__pyx_v_begin_list = NULL;
PyObject *__pyx_v_ret = NULL;
PyObject *__pyx_v_n = NULL;
PyObject *__pyx_v_end_list = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
PyObject *(*__pyx_t_4)(PyObject *);
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("__str__", 0);
/* "lib/intbitset.pyx":439
* def __str__(self):
* cdef int tot
* tot = intBitSetGetTot(self.bitset) # <<<<<<<<<<<<<<
* if tot < 0:
* begin_list = self[0:10]
*/
__pyx_v_tot = intBitSetGetTot(__pyx_v_self->bitset);
/* "lib/intbitset.pyx":440
* cdef int tot
* tot = intBitSetGetTot(self.bitset)
* if tot < 0: # <<<<<<<<<<<<<<
* begin_list = self[0:10]
* ret = "intbitset(["
*/
__pyx_t_1 = (__pyx_v_tot < 0);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":441
* tot = intBitSetGetTot(self.bitset)
* if tot < 0:
* begin_list = self[0:10] # <<<<<<<<<<<<<<
* ret = "intbitset(["
* for n in begin_list:
*/
__pyx_t_2 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_self), 0, 10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_begin_list = __pyx_t_2;
__pyx_t_2 = 0;
/* "lib/intbitset.pyx":442
* if tot < 0:
* begin_list = self[0:10]
* ret = "intbitset([" # <<<<<<<<<<<<<<
* for n in begin_list:
* ret = ret + '%i, ' % n
*/
__Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
__pyx_v_ret = ((PyObject *)__pyx_kp_s_29);
/* "lib/intbitset.pyx":443
* begin_list = self[0:10]
* ret = "intbitset(["
* for n in begin_list: # <<<<<<<<<<<<<<
* ret = ret + '%i, ' % n
* ret = ret + "...])"
*/
if (PyList_CheckExact(__pyx_v_begin_list) || PyTuple_CheckExact(__pyx_v_begin_list)) {
__pyx_t_2 = __pyx_v_begin_list; __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_begin_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
for (;;) {
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 (!__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 {
__pyx_t_5 = __pyx_t_4(__pyx_t_2);
if (unlikely(!__pyx_t_5)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_5);
}
__Pyx_XDECREF(__pyx_v_n);
__pyx_v_n = __pyx_t_5;
__pyx_t_5 = 0;
/* "lib/intbitset.pyx":444
* ret = "intbitset(["
* for n in begin_list:
* ret = ret + '%i, ' % n # <<<<<<<<<<<<<<
* ret = ret + "...])"
* return ret
*/
__pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_30), __pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
__pyx_t_6 = PyNumber_Add(__pyx_v_ret, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_v_ret);
__pyx_v_ret = __pyx_t_6;
__pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "lib/intbitset.pyx":445
* for n in begin_list:
* ret = ret + '%i, ' % n
* ret = ret + "...])" # <<<<<<<<<<<<<<
* return ret
* elif tot > 10:
*/
__pyx_t_2 = PyNumber_Add(__pyx_v_ret, ((PyObject *)__pyx_kp_s_31)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_ret);
__pyx_v_ret = __pyx_t_2;
__pyx_t_2 = 0;
/* "lib/intbitset.pyx":446
* ret = ret + '%i, ' % n
* ret = ret + "...])"
* return ret # <<<<<<<<<<<<<<
* elif tot > 10:
* begin_list = self[0:5]
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_ret);
__pyx_r = __pyx_v_ret;
goto __pyx_L0;
goto __pyx_L3;
}
/* "lib/intbitset.pyx":447
* ret = ret + "...])"
* return ret
* elif tot > 10: # <<<<<<<<<<<<<<
* begin_list = self[0:5]
* end_list = self[tot - 5:tot]
*/
__pyx_t_1 = (__pyx_v_tot > 10);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":448
* return ret
* elif tot > 10:
* begin_list = self[0:5] # <<<<<<<<<<<<<<
* end_list = self[tot - 5:tot]
* ret = "intbitset(["
*/
__pyx_t_2 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_self), 0, 5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_begin_list = __pyx_t_2;
__pyx_t_2 = 0;
/* "lib/intbitset.pyx":449
* elif tot > 10:
* begin_list = self[0:5]
* end_list = self[tot - 5:tot] # <<<<<<<<<<<<<<
* ret = "intbitset(["
* for n in begin_list:
*/
__pyx_t_2 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_self), (__pyx_v_tot - 5), __pyx_v_tot); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_end_list = __pyx_t_2;
__pyx_t_2 = 0;
/* "lib/intbitset.pyx":450
* begin_list = self[0:5]
* end_list = self[tot - 5:tot]
* ret = "intbitset([" # <<<<<<<<<<<<<<
* for n in begin_list:
* ret = ret + '%i, ' % n
*/
__Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
__pyx_v_ret = ((PyObject *)__pyx_kp_s_29);
/* "lib/intbitset.pyx":451
* end_list = self[tot - 5:tot]
* ret = "intbitset(["
* for n in begin_list: # <<<<<<<<<<<<<<
* ret = ret + '%i, ' % n
* ret = ret + "..., "
*/
if (PyList_CheckExact(__pyx_v_begin_list) || PyTuple_CheckExact(__pyx_v_begin_list)) {
__pyx_t_2 = __pyx_v_begin_list; __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_begin_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
for (;;) {
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
__pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++;
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
__pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++;
} else {
__pyx_t_6 = __pyx_t_4(__pyx_t_2);
if (unlikely(!__pyx_t_6)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_6);
}
__Pyx_XDECREF(__pyx_v_n);
__pyx_v_n = __pyx_t_6;
__pyx_t_6 = 0;
/* "lib/intbitset.pyx":452
* ret = "intbitset(["
* for n in begin_list:
* ret = ret + '%i, ' % n # <<<<<<<<<<<<<<
* ret = ret + "..., "
* for n in end_list:
*/
__pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_30), __pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_6));
__pyx_t_5 = PyNumber_Add(__pyx_v_ret, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_v_ret);
__pyx_v_ret = __pyx_t_5;
__pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "lib/intbitset.pyx":453
* for n in begin_list:
* ret = ret + '%i, ' % n
* ret = ret + "..., " # <<<<<<<<<<<<<<
* for n in end_list:
* ret = ret + '%i, ' % n
*/
__pyx_t_2 = PyNumber_Add(__pyx_v_ret, ((PyObject *)__pyx_kp_s_32)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_ret);
__pyx_v_ret = __pyx_t_2;
__pyx_t_2 = 0;
/* "lib/intbitset.pyx":454
* ret = ret + '%i, ' % n
* ret = ret + "..., "
* for n in end_list: # <<<<<<<<<<<<<<
* ret = ret + '%i, ' % n
* ret = ret[:-2]
*/
if (PyList_CheckExact(__pyx_v_end_list) || PyTuple_CheckExact(__pyx_v_end_list)) {
__pyx_t_2 = __pyx_v_end_list; __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_end_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
for (;;) {
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 (!__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 {
__pyx_t_5 = __pyx_t_4(__pyx_t_2);
if (unlikely(!__pyx_t_5)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_5);
}
__Pyx_XDECREF(__pyx_v_n);
__pyx_v_n = __pyx_t_5;
__pyx_t_5 = 0;
/* "lib/intbitset.pyx":455
* ret = ret + "..., "
* for n in end_list:
* ret = ret + '%i, ' % n # <<<<<<<<<<<<<<
* ret = ret[:-2]
* ret = ret + '])'
*/
__pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_30), __pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
__pyx_t_6 = PyNumber_Add(__pyx_v_ret, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_v_ret);
__pyx_v_ret = __pyx_t_6;
__pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "lib/intbitset.pyx":456
* for n in end_list:
* ret = ret + '%i, ' % n
* ret = ret[:-2] # <<<<<<<<<<<<<<
* ret = ret + '])'
* return ret
*/
__pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_ret, 0, -2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_ret);
__pyx_v_ret = __pyx_t_2;
__pyx_t_2 = 0;
/* "lib/intbitset.pyx":457
* ret = ret + '%i, ' % n
* ret = ret[:-2]
* ret = ret + '])' # <<<<<<<<<<<<<<
* return ret
* else:
*/
__pyx_t_2 = PyNumber_Add(__pyx_v_ret, ((PyObject *)__pyx_kp_s_33)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_ret);
__pyx_v_ret = __pyx_t_2;
__pyx_t_2 = 0;
/* "lib/intbitset.pyx":458
* ret = ret[:-2]
* ret = ret + '])'
* return ret # <<<<<<<<<<<<<<
* else:
* return self.__repr__()
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_ret);
__pyx_r = __pyx_v_ret;
goto __pyx_L0;
goto __pyx_L3;
}
/*else*/ {
/* "lib/intbitset.pyx":460
* return ret
* else:
* return self.__repr__() # <<<<<<<<<<<<<<
*
* def __getitem__(self, key):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s____repr__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
}
__pyx_L3:;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("lib.intbitset.intbitset.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_begin_list);
__Pyx_XDECREF(__pyx_v_ret);
__Pyx_XDECREF(__pyx_v_n);
__Pyx_XDECREF(__pyx_v_end_list);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_43__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_43__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_42__getitem__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((PyObject *)__pyx_v_key));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":462
* return self.__repr__()
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
* cdef Py_ssize_t i
* cdef int elem = -1
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_42__getitem__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_key) {
Py_ssize_t __pyx_v_i;
int __pyx_v_elem;
int __pyx_v_start;
int __pyx_v_end;
int __pyx_v_step;
struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_retset = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *(*__pyx_t_9)(PyObject *);
int __pyx_t_10;
int __pyx_t_11;
int __pyx_t_12;
Py_ssize_t __pyx_t_13;
long __pyx_t_14;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
/* "lib/intbitset.pyx":464
* def __getitem__(self, key):
* cdef Py_ssize_t i
* cdef int elem = -1 # <<<<<<<<<<<<<<
* cdef int start
* cdef int end
*/
__pyx_v_elem = -1;
/* "lib/intbitset.pyx":468
* cdef int end
* cdef int step
* if hasattr(key, 'indices'): # <<<<<<<<<<<<<<
* ## This is a slice object!
* if self.bitset.trailing_bits and (key.start < 0 or key.stop < 0):
*/
__pyx_t_1 = ((PyObject *)__pyx_n_s__indices);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_2 = PyObject_HasAttr(__pyx_v_key, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "lib/intbitset.pyx":470
* if hasattr(key, 'indices'):
* ## This is a slice object!
* if self.bitset.trailing_bits and (key.start < 0 or key.stop < 0): # <<<<<<<<<<<<<<
* raise IndexError("negative indexes are not allowed on infinite intbitset")
* retset = intbitset()
*/
if (__pyx_v_self->bitset->trailing_bits) {
__pyx_t_1 = PyObject_GetAttr(__pyx_v_key, __pyx_n_s__start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (!__pyx_t_2) {
__pyx_t_3 = PyObject_GetAttr(__pyx_v_key, __pyx_n_s__stop); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = __pyx_t_4;
} else {
__pyx_t_5 = __pyx_t_2;
}
__pyx_t_2 = __pyx_t_5;
} else {
__pyx_t_2 = __pyx_v_self->bitset->trailing_bits;
}
if (__pyx_t_2) {
/* "lib/intbitset.pyx":471
* ## This is a slice object!
* if self.bitset.trailing_bits and (key.start < 0 or key.stop < 0):
* raise IndexError("negative indexes are not allowed on infinite intbitset") # <<<<<<<<<<<<<<
* retset = intbitset()
* start, end, step = key.indices(intBitSetGetTot(self.bitset))
*/
__pyx_t_1 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
__pyx_L4:;
/* "lib/intbitset.pyx":472
* if self.bitset.trailing_bits and (key.start < 0 or key.stop < 0):
* raise IndexError("negative indexes are not allowed on infinite intbitset")
* retset = intbitset() # <<<<<<<<<<<<<<
* start, end, step = key.indices(intBitSetGetTot(self.bitset))
* if step < 0:
*/
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3lib_9intbitset_intbitset)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_retset = ((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_t_1);
__pyx_t_1 = 0;
/* "lib/intbitset.pyx":473
* raise IndexError("negative indexes are not allowed on infinite intbitset")
* retset = intbitset()
* start, end, step = key.indices(intBitSetGetTot(self.bitset)) # <<<<<<<<<<<<<<
* if step < 0:
* raise ValueError("negative steps are not yet supported")
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_key, __pyx_n_s__indices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyInt_FromLong(intBitSetGetTot(__pyx_v_self->bitset)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
PyObject* sequence = __pyx_t_3;
if (likely(PyTuple_CheckExact(sequence))) {
if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) {
if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3);
else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
} else {
if (unlikely(PyList_GET_SIZE(sequence) != 3)) {
if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3);
else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_6 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_7 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
index = 1; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_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 = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L6_unpacking_done:;
}
__pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_12 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_start = __pyx_t_10;
__pyx_v_end = __pyx_t_11;
__pyx_v_step = __pyx_t_12;
/* "lib/intbitset.pyx":474
* retset = intbitset()
* start, end, step = key.indices(intBitSetGetTot(self.bitset))
* if step < 0: # <<<<<<<<<<<<<<
* raise ValueError("negative steps are not yet supported")
* for i in range(start):
*/
__pyx_t_2 = (__pyx_v_step < 0);
if (__pyx_t_2) {
/* "lib/intbitset.pyx":475
* start, end, step = key.indices(intBitSetGetTot(self.bitset))
* if step < 0:
* raise ValueError("negative steps are not yet supported") # <<<<<<<<<<<<<<
* for i in range(start):
* elem = intBitSetGetNext(self.bitset, elem)
*/
__pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L7;
}
__pyx_L7:;
/* "lib/intbitset.pyx":476
* if step < 0:
* raise ValueError("negative steps are not yet supported")
* for i in range(start): # <<<<<<<<<<<<<<
* elem = intBitSetGetNext(self.bitset, elem)
* if elem < 0:
*/
__pyx_t_12 = __pyx_v_start;
for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
__pyx_v_i = __pyx_t_13;
/* "lib/intbitset.pyx":477
* raise ValueError("negative steps are not yet supported")
* for i in range(start):
* elem = intBitSetGetNext(self.bitset, elem) # <<<<<<<<<<<<<<
* if elem < 0:
* return retset
*/
__pyx_v_elem = intBitSetGetNext(__pyx_v_self->bitset, __pyx_v_elem);
/* "lib/intbitset.pyx":478
* for i in range(start):
* elem = intBitSetGetNext(self.bitset, elem)
* if elem < 0: # <<<<<<<<<<<<<<
* return retset
* for i in range(end - start):
*/
__pyx_t_2 = (__pyx_v_elem < 0);
if (__pyx_t_2) {
/* "lib/intbitset.pyx":479
* elem = intBitSetGetNext(self.bitset, elem)
* if elem < 0:
* return retset # <<<<<<<<<<<<<<
* for i in range(end - start):
* elem = intBitSetGetNext(self.bitset, elem)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_retset));
__pyx_r = ((PyObject *)__pyx_v_retset);
goto __pyx_L0;
goto __pyx_L10;
}
__pyx_L10:;
}
/* "lib/intbitset.pyx":480
* if elem < 0:
* return retset
* for i in range(end - start): # <<<<<<<<<<<<<<
* elem = intBitSetGetNext(self.bitset, elem)
* if elem < 0:
*/
__pyx_t_12 = (__pyx_v_end - __pyx_v_start);
for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
__pyx_v_i = __pyx_t_13;
/* "lib/intbitset.pyx":481
* return retset
* for i in range(end - start):
* elem = intBitSetGetNext(self.bitset, elem) # <<<<<<<<<<<<<<
* if elem < 0:
* return retset
*/
__pyx_v_elem = intBitSetGetNext(__pyx_v_self->bitset, __pyx_v_elem);
/* "lib/intbitset.pyx":482
* for i in range(end - start):
* elem = intBitSetGetNext(self.bitset, elem)
* if elem < 0: # <<<<<<<<<<<<<<
* return retset
* if i % step == 0:
*/
__pyx_t_2 = (__pyx_v_elem < 0);
if (__pyx_t_2) {
/* "lib/intbitset.pyx":483
* elem = intBitSetGetNext(self.bitset, elem)
* if elem < 0:
* return retset # <<<<<<<<<<<<<<
* if i % step == 0:
* retset.add(elem)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_retset));
__pyx_r = ((PyObject *)__pyx_v_retset);
goto __pyx_L0;
goto __pyx_L13;
}
__pyx_L13:;
/* "lib/intbitset.pyx":484
* if elem < 0:
* return retset
* if i % step == 0: # <<<<<<<<<<<<<<
* retset.add(elem)
* return retset
*/
if (unlikely(__pyx_v_step == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_2 = (__Pyx_mod_Py_ssize_t(__pyx_v_i, __pyx_v_step) == 0);
if (__pyx_t_2) {
/* "lib/intbitset.pyx":485
* return retset
* if i % step == 0:
* retset.add(elem) # <<<<<<<<<<<<<<
* return retset
* else:
*/
__pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_retset), __pyx_n_s__add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_7 = PyInt_FromLong(__pyx_v_elem); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
__pyx_t_7 = 0;
__pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L14;
}
__pyx_L14:;
}
/* "lib/intbitset.pyx":486
* if i % step == 0:
* retset.add(elem)
* return retset # <<<<<<<<<<<<<<
* else:
* end = key
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_retset));
__pyx_r = ((PyObject *)__pyx_v_retset);
goto __pyx_L0;
goto __pyx_L3;
}
/*else*/ {
/* "lib/intbitset.pyx":488
* return retset
* else:
* end = key # <<<<<<<<<<<<<<
* if end < 0:
* if self.bitset.trailing_bits:
*/
__pyx_t_12 = __Pyx_PyInt_AsInt(__pyx_v_key); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_end = __pyx_t_12;
/* "lib/intbitset.pyx":489
* else:
* end = key
* if end < 0: # <<<<<<<<<<<<<<
* if self.bitset.trailing_bits:
* raise IndexError("negative indexes are not allowed on infinite intbitset")
*/
__pyx_t_2 = (__pyx_v_end < 0);
if (__pyx_t_2) {
/* "lib/intbitset.pyx":490
* end = key
* if end < 0:
* if self.bitset.trailing_bits: # <<<<<<<<<<<<<<
* raise IndexError("negative indexes are not allowed on infinite intbitset")
* end += intBitSetGetTot(self.bitset)
*/
if (__pyx_v_self->bitset->trailing_bits) {
/* "lib/intbitset.pyx":491
* if end < 0:
* if self.bitset.trailing_bits:
* raise IndexError("negative indexes are not allowed on infinite intbitset") # <<<<<<<<<<<<<<
* end += intBitSetGetTot(self.bitset)
* if end < 0:
*/
__pyx_t_7 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_38), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_Raise(__pyx_t_7, 0, 0, 0);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L16;
}
__pyx_L16:;
/* "lib/intbitset.pyx":492
* if self.bitset.trailing_bits:
* raise IndexError("negative indexes are not allowed on infinite intbitset")
* end += intBitSetGetTot(self.bitset) # <<<<<<<<<<<<<<
* if end < 0:
* raise IndexError("intbitset index out of range")
*/
__pyx_v_end = (__pyx_v_end + intBitSetGetTot(__pyx_v_self->bitset));
/* "lib/intbitset.pyx":493
* raise IndexError("negative indexes are not allowed on infinite intbitset")
* end += intBitSetGetTot(self.bitset)
* if end < 0: # <<<<<<<<<<<<<<
* raise IndexError("intbitset index out of range")
* if end >= intBitSetGetTot(self.bitset):
*/
__pyx_t_2 = (__pyx_v_end < 0);
if (__pyx_t_2) {
/* "lib/intbitset.pyx":494
* end += intBitSetGetTot(self.bitset)
* if end < 0:
* raise IndexError("intbitset index out of range") # <<<<<<<<<<<<<<
* if end >= intBitSetGetTot(self.bitset):
* raise IndexError("intbitset index out of range")
*/
__pyx_t_7 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_40), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_Raise(__pyx_t_7, 0, 0, 0);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L17;
}
__pyx_L17:;
goto __pyx_L15;
}
__pyx_L15:;
/* "lib/intbitset.pyx":495
* if end < 0:
* raise IndexError("intbitset index out of range")
* if end >= intBitSetGetTot(self.bitset): # <<<<<<<<<<<<<<
* raise IndexError("intbitset index out of range")
* for i in range(end + 1):
*/
__pyx_t_2 = (__pyx_v_end >= intBitSetGetTot(__pyx_v_self->bitset));
if (__pyx_t_2) {
/* "lib/intbitset.pyx":496
* raise IndexError("intbitset index out of range")
* if end >= intBitSetGetTot(self.bitset):
* raise IndexError("intbitset index out of range") # <<<<<<<<<<<<<<
* for i in range(end + 1):
* elem = intBitSetGetNext(self.bitset, elem)
*/
__pyx_t_7 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_41), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_Raise(__pyx_t_7, 0, 0, 0);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L18;
}
__pyx_L18:;
/* "lib/intbitset.pyx":497
* if end >= intBitSetGetTot(self.bitset):
* raise IndexError("intbitset index out of range")
* for i in range(end + 1): # <<<<<<<<<<<<<<
* elem = intBitSetGetNext(self.bitset, elem)
* return elem
*/
__pyx_t_14 = (__pyx_v_end + 1);
for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) {
__pyx_v_i = __pyx_t_13;
/* "lib/intbitset.pyx":498
* raise IndexError("intbitset index out of range")
* for i in range(end + 1):
* elem = intBitSetGetNext(self.bitset, elem) # <<<<<<<<<<<<<<
* return elem
*
*/
__pyx_v_elem = intBitSetGetNext(__pyx_v_self->bitset, __pyx_v_elem);
}
/* "lib/intbitset.pyx":499
* for i in range(end + 1):
* elem = intBitSetGetNext(self.bitset, elem)
* return elem # <<<<<<<<<<<<<<
*
* #def __getslice__(self, Py_ssize_t key1, Py_ssize_t key2):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_7 = PyInt_FromLong(__pyx_v_elem); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_r = __pyx_t_7;
__pyx_t_7 = 0;
goto __pyx_L0;
}
__pyx_L3:;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("lib.intbitset.intbitset.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_retset);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_45__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_45__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_44__reduce__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":552
*
* # pickle interface
* def __reduce__(self): # <<<<<<<<<<<<<<
* return _, (self.fastdump(),)
*
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_44__reduce__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__reduce__", 0);
/* "lib/intbitset.pyx":553
* # pickle interface
* def __reduce__(self):
* return _, (self.fastdump(),) # <<<<<<<<<<<<<<
*
* __safe_for_unpickling__ = True
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fastdump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __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 = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__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 = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __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);
PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_r = ((PyObject *)__pyx_t_3);
__pyx_t_3 = 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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("lib.intbitset.intbitset.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_47__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_47__iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_46__iter__(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":558
*
* # Iterator interface
* def __iter__(self): # <<<<<<<<<<<<<<
* if self.bitset.trailing_bits:
* raise OverflowError("It's impossible to iterate over an infinite set.")
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_46__iter__(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__iter__", 0);
/* "lib/intbitset.pyx":559
* # Iterator interface
* def __iter__(self):
* if self.bitset.trailing_bits: # <<<<<<<<<<<<<<
* raise OverflowError("It's impossible to iterate over an infinite set.")
* return intbitset_iterator(self)
*/
if (__pyx_v_self->bitset->trailing_bits) {
/* "lib/intbitset.pyx":560
* def __iter__(self):
* if self.bitset.trailing_bits:
* raise OverflowError("It's impossible to iterate over an infinite set.") # <<<<<<<<<<<<<<
* return intbitset_iterator(self)
*
*/
__pyx_t_1 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_k_tuple_43), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L3;
}
__pyx_L3:;
/* "lib/intbitset.pyx":561
* if self.bitset.trailing_bits:
* raise OverflowError("It's impossible to iterate over an infinite set.")
* return intbitset_iterator(self) # <<<<<<<<<<<<<<
*
* # Customized interface
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
__pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3lib_9intbitset_intbitset_iterator)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__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("lib.intbitset.intbitset.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_49add(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_48add[] = "Add an element to a set.\n This has no effect if the element is already present.";
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_49add(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem) {
int __pyx_v_elem;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add (wrapper)", 0);
assert(__pyx_arg_elem); {
__pyx_v_elem = __Pyx_PyInt_AsInt(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_AddTraceback("lib.intbitset.intbitset.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_48add(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((int)__pyx_v_elem));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":564
*
* # Customized interface
* def add(self, int elem): # <<<<<<<<<<<<<<
* """Add an element to a set.
* This has no effect if the element is already present."""
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_48add(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, int __pyx_v_elem) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add", 0);
/* "lib/intbitset.pyx":567
* """Add an element to a set.
* This has no effect if the element is already present."""
* if self.sanity_checks: # <<<<<<<<<<<<<<
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
*/
if (__pyx_v_self->sanity_checks) {
/* "lib/intbitset.pyx":568
* This has no effect if the element is already present."""
* if self.sanity_checks:
* if elem < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
*/
__pyx_t_1 = (__pyx_v_elem < 0);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":569
* if self.sanity_checks:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem)
*/
__pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_44), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __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 = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
/* "lib/intbitset.pyx":570
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("Element must be <= %s" % maxelem)
* intBitSetAddElem(self.bitset, elem)
*/
__pyx_t_1 = (__pyx_v_elem > maxelem);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":571
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* intBitSetAddElem(self.bitset, elem)
*
*/
__pyx_t_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __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 = 571; __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_OverflowError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __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 = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
__pyx_L4:;
goto __pyx_L3;
}
__pyx_L3:;
/* "lib/intbitset.pyx":572
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem)
* intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<<
*
* def clear(self):
*/
intBitSetAddElem(__pyx_v_self->bitset, __pyx_v_elem);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("lib.intbitset.intbitset.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_51clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_51clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("clear (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_50clear(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":574
* intBitSetAddElem(self.bitset, elem)
*
* def clear(self): # <<<<<<<<<<<<<<
* intBitSetReset(self.bitset)
*
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_50clear(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("clear", 0);
/* "lib/intbitset.pyx":575
*
* def clear(self):
* intBitSetReset(self.bitset) # <<<<<<<<<<<<<<
*
*
*/
intBitSetReset(__pyx_v_self->bitset);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_53discard(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_52discard[] = "Remove an element from a intbitset if it is a member.\n If the element is not a member, do nothing.";
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_53discard(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem) {
int __pyx_v_elem;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("discard (wrapper)", 0);
assert(__pyx_arg_elem); {
__pyx_v_elem = __Pyx_PyInt_AsInt(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_AddTraceback("lib.intbitset.intbitset.discard", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_52discard(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((int)__pyx_v_elem));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":578
*
*
* def discard(self, int elem): # <<<<<<<<<<<<<<
* """Remove an element from a intbitset if it is a member.
* If the element is not a member, do nothing."""
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_52discard(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, int __pyx_v_elem) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("discard", 0);
/* "lib/intbitset.pyx":581
* """Remove an element from a intbitset if it is a member.
* If the element is not a member, do nothing."""
* if self.sanity_checks: # <<<<<<<<<<<<<<
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
*/
if (__pyx_v_self->sanity_checks) {
/* "lib/intbitset.pyx":582
* If the element is not a member, do nothing."""
* if self.sanity_checks:
* if elem < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
*/
__pyx_t_1 = (__pyx_v_elem < 0);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":583
* if self.sanity_checks:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem)
*/
__pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_45), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __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 = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
/* "lib/intbitset.pyx":584
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("Element must be <= %s" % maxelem)
* intBitSetDelElem(self.bitset, elem)
*/
__pyx_t_1 = (__pyx_v_elem > maxelem);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":585
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* intBitSetDelElem(self.bitset, elem)
*
*/
__pyx_t_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __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 = 585; __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_OverflowError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __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 = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
__pyx_L4:;
goto __pyx_L3;
}
__pyx_L3:;
/* "lib/intbitset.pyx":586
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem)
* intBitSetDelElem(self.bitset, elem) # <<<<<<<<<<<<<<
*
* difference = __sub__
*/
intBitSetDelElem(__pyx_v_self->bitset, __pyx_v_elem);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("lib.intbitset.intbitset.discard", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_55issubset(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_54issubset[] = "Report whether another set contains this set.";
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_55issubset(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("issubset (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_54issubset(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":597
* symmetric_difference_update = __ixor__
*
* def issubset(self, rhs): # <<<<<<<<<<<<<<
* """Report whether another set contains this set."""
* return self.__le__(rhs)
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_54issubset(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_rhs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("issubset", 0);
/* "lib/intbitset.pyx":599
* def issubset(self, rhs):
* """Report whether another set contains this set."""
* return self.__le__(rhs) # <<<<<<<<<<<<<<
*
* def issuperset(self, rhs):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s____le__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __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 = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_rhs);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_rhs);
__Pyx_GIVEREF(__pyx_v_rhs);
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("lib.intbitset.intbitset.issubset", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_57issuperset(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_56issuperset[] = "Report whether this set contains another set.";
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_57issuperset(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("issuperset (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_56issuperset(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":601
* return self.__le__(rhs)
*
* def issuperset(self, rhs): # <<<<<<<<<<<<<<
* """Report whether this set contains another set."""
* return self.__ge__(rhs)
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_56issuperset(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_rhs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("issuperset", 0);
/* "lib/intbitset.pyx":603
* def issuperset(self, rhs):
* """Report whether this set contains another set."""
* return self.__ge__(rhs) # <<<<<<<<<<<<<<
*
* # Dumping & Loading
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s____ge__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __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 = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_rhs);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_rhs);
__Pyx_GIVEREF(__pyx_v_rhs);
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("lib.intbitset.intbitset.issuperset", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_59fastdump(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_58fastdump[] = "Return a compressed string representation suitable to be saved\n somewhere.";
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_59fastdump(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("fastdump (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_58fastdump(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":606
*
* # Dumping & Loading
* def fastdump(self): # <<<<<<<<<<<<<<
* """Return a compressed string representation suitable to be saved
* somewhere."""
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_58fastdump(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self) {
Py_ssize_t __pyx_v_size;
PyObject *__pyx_v_tmp = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("fastdump", 0);
/* "lib/intbitset.pyx":610
* somewhere."""
* cdef Py_ssize_t size
* size = intBitSetGetSize((<intbitset> self).bitset) # <<<<<<<<<<<<<<
* tmp = PyString_FromStringAndSize(<char *>self.bitset.bitset, ( size + 1) * wordbytesize)
* return zlib.compress(tmp)
*/
__pyx_v_size = intBitSetGetSize(__pyx_v_self->bitset);
/* "lib/intbitset.pyx":611
* cdef Py_ssize_t size
* size = intBitSetGetSize((<intbitset> self).bitset)
* tmp = PyString_FromStringAndSize(<char *>self.bitset.bitset, ( size + 1) * wordbytesize) # <<<<<<<<<<<<<<
* return zlib.compress(tmp)
*
*/
__pyx_t_1 = PyString_FromStringAndSize(((char *)__pyx_v_self->bitset->bitset), ((__pyx_v_size + 1) * wordbytesize)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tmp = __pyx_t_1;
__pyx_t_1 = 0;
/* "lib/intbitset.pyx":612
* size = intBitSetGetSize((<intbitset> self).bitset)
* tmp = PyString_FromStringAndSize(<char *>self.bitset.bitset, ( size + 1) * wordbytesize)
* return zlib.compress(tmp) # <<<<<<<<<<<<<<
*
* def fastload(self, strdump):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__zlib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__compress); 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_1); __pyx_t_1 = 0;
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_tmp);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tmp);
__Pyx_GIVEREF(__pyx_v_tmp);
__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 = 612; __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_r = __pyx_t_3;
__pyx_t_3 = 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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("lib.intbitset.intbitset.fastdump", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_61fastload(PyObject *__pyx_v_self, PyObject *__pyx_v_strdump); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_60fastload[] = "Load a compressed string representation produced by a previous call\n to the fastdump method into the current intbitset. The previous content\n will be replaced.";
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_61fastload(PyObject *__pyx_v_self, PyObject *__pyx_v_strdump) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("fastload (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_60fastload(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((PyObject *)__pyx_v_strdump));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":614
* return zlib.compress(tmp)
*
* def fastload(self, strdump): # <<<<<<<<<<<<<<
* """Load a compressed string representation produced by a previous call
* to the fastdump method into the current intbitset. The previous content
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_60fastload(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_strdump) {
Py_ssize_t __pyx_v_size;
const void* __pyx_v_buf;
PyObject *__pyx_v_tmp = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
Py_ssize_t __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("fastload", 0);
__Pyx_INCREF(__pyx_v_strdump);
/* "lib/intbitset.pyx":620
* cdef Py_ssize_t size
* cdef const_void_ptr buf
* buf = NULL # <<<<<<<<<<<<<<
* size = 0
* try:
*/
__pyx_v_buf = NULL;
/* "lib/intbitset.pyx":621
* cdef const_void_ptr buf
* buf = NULL
* size = 0 # <<<<<<<<<<<<<<
* try:
* if type(strdump) is array:
*/
__pyx_v_size = 0;
/* "lib/intbitset.pyx":622
* buf = NULL
* size = 0
* try: # <<<<<<<<<<<<<<
* if type(strdump) is array:
* strdump = strdump.tostring()
*/
{
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "lib/intbitset.pyx":623
* size = 0
* try:
* if type(strdump) is array: # <<<<<<<<<<<<<<
* strdump = strdump.tostring()
* # tmp needed to not be garbage collected
*/
__pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_strdump)) == __pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
/* "lib/intbitset.pyx":624
* try:
* if type(strdump) is array:
* strdump = strdump.tostring() # <<<<<<<<<<<<<<
* # tmp needed to not be garbage collected
* tmp = zlib.decompress(strdump)
*/
__pyx_t_4 = PyObject_GetAttr(__pyx_v_strdump, __pyx_n_s__tostring); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_v_strdump);
__pyx_v_strdump = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L11;
}
__pyx_L11:;
/* "lib/intbitset.pyx":626
* strdump = strdump.tostring()
* # tmp needed to not be garbage collected
* tmp = zlib.decompress(strdump) # <<<<<<<<<<<<<<
* if PyObject_AsReadBuffer(tmp, &buf, &size) < 0:
* raise Exception()
*/
__pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__zlib); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__decompress); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_strdump);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_strdump);
__Pyx_GIVEREF(__pyx_v_strdump);
__pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
__pyx_v_tmp = __pyx_t_7;
__pyx_t_7 = 0;
/* "lib/intbitset.pyx":627
* # tmp needed to not be garbage collected
* tmp = zlib.decompress(strdump)
* if PyObject_AsReadBuffer(tmp, &buf, &size) < 0: # <<<<<<<<<<<<<<
* raise Exception()
* if (size % wordbytesize):
*/
__pyx_t_5 = (PyObject_AsReadBuffer(__pyx_v_tmp, (&__pyx_v_buf), (&__pyx_v_size)) < 0);
if (__pyx_t_5) {
/* "lib/intbitset.pyx":628
* tmp = zlib.decompress(strdump)
* if PyObject_AsReadBuffer(tmp, &buf, &size) < 0:
* raise Exception() # <<<<<<<<<<<<<<
* if (size % wordbytesize):
* ## Wrong size!
*/
__pyx_t_7 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_Raise(__pyx_t_7, 0, 0, 0);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
goto __pyx_L12;
}
__pyx_L12:;
/* "lib/intbitset.pyx":629
* if PyObject_AsReadBuffer(tmp, &buf, &size) < 0:
* raise Exception()
* if (size % wordbytesize): # <<<<<<<<<<<<<<
* ## Wrong size!
* raise Exception()
*/
if (unlikely(wordbytesize == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
__pyx_t_8 = __Pyx_mod_Py_ssize_t(__pyx_v_size, wordbytesize);
if (__pyx_t_8) {
/* "lib/intbitset.pyx":631
* if (size % wordbytesize):
* ## Wrong size!
* raise Exception() # <<<<<<<<<<<<<<
* intBitSetResetFromBuffer((<intbitset> self).bitset, buf, size)
* except:
*/
__pyx_t_7 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_Raise(__pyx_t_7, 0, 0, 0);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
goto __pyx_L13;
}
__pyx_L13:;
/* "lib/intbitset.pyx":632
* ## Wrong size!
* raise Exception()
* intBitSetResetFromBuffer((<intbitset> self).bitset, buf, size) # <<<<<<<<<<<<<<
* except:
* raise ValueError("strdump is corrupted")
*/
intBitSetResetFromBuffer(__pyx_v_self->bitset, __pyx_v_buf, __pyx_v_size);
}
__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_L10_try_end;
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "lib/intbitset.pyx":633
* raise Exception()
* intBitSetResetFromBuffer((<intbitset> self).bitset, buf, size)
* except: # <<<<<<<<<<<<<<
* raise ValueError("strdump is corrupted")
* return self
*/
/*except:*/ {
__Pyx_AddTraceback("lib.intbitset.intbitset.fastload", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_4);
/* "lib/intbitset.pyx":634
* intBitSetResetFromBuffer((<intbitset> self).bitset, buf, size)
* except:
* raise ValueError("strdump is corrupted") # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_9 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L4_exception_handled;
}
__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_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_L10_try_end:;
}
/* "lib/intbitset.pyx":635
* except:
* raise ValueError("strdump is corrupted")
* return self # <<<<<<<<<<<<<<
*
* def copy(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("lib.intbitset.intbitset.fastload", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp);
__Pyx_XDECREF(__pyx_v_strdump);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_63copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_62copy[] = "Return a shallow copy of a set.";
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_63copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("copy (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_62copy(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":637
* return self
*
* def copy(self): # <<<<<<<<<<<<<<
* """Return a shallow copy of a set."""
* return intbitset(self)
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_62copy(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("copy", 0);
/* "lib/intbitset.pyx":639
* def copy(self):
* """Return a shallow copy of a set."""
* return intbitset(self) # <<<<<<<<<<<<<<
*
* def pop(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
__pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3lib_9intbitset_intbitset)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__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("lib.intbitset.intbitset.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_65pop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_64pop[] = "Remove and return an arbitrary set element.\n\n @note: intbitset implementation of .pop() differs from the native C{set}\n implementation by guaranteeing returning always the largest element.\n ";
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_65pop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pop (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_64pop(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":641
* return intbitset(self)
*
* def pop(self): # <<<<<<<<<<<<<<
* """Remove and return an arbitrary set element.
*
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_64pop(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self) {
int __pyx_v_ret;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pop", 0);
/* "lib/intbitset.pyx":648
* """
* cdef int ret
* ret = intBitSetGetLast(self.bitset) # <<<<<<<<<<<<<<
* if ret < 0:
* raise KeyError("pop from an empty or infinite intbitset")
*/
__pyx_v_ret = intBitSetGetLast(__pyx_v_self->bitset);
/* "lib/intbitset.pyx":649
* cdef int ret
* ret = intBitSetGetLast(self.bitset)
* if ret < 0: # <<<<<<<<<<<<<<
* raise KeyError("pop from an empty or infinite intbitset")
* intBitSetDelElem(self.bitset, ret)
*/
__pyx_t_1 = (__pyx_v_ret < 0);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":650
* ret = intBitSetGetLast(self.bitset)
* if ret < 0:
* raise KeyError("pop from an empty or infinite intbitset") # <<<<<<<<<<<<<<
* intBitSetDelElem(self.bitset, ret)
* return ret
*/
__pyx_t_2 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_k_tuple_49), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __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 = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L3;
}
__pyx_L3:;
/* "lib/intbitset.pyx":651
* if ret < 0:
* raise KeyError("pop from an empty or infinite intbitset")
* intBitSetDelElem(self.bitset, ret) # <<<<<<<<<<<<<<
* return ret
*
*/
intBitSetDelElem(__pyx_v_self->bitset, __pyx_v_ret);
/* "lib/intbitset.pyx":652
* raise KeyError("pop from an empty or infinite intbitset")
* intBitSetDelElem(self.bitset, ret)
* return ret # <<<<<<<<<<<<<<
*
* def remove(self, int elem):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __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_2);
__Pyx_AddTraceback("lib.intbitset.intbitset.pop", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_67remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_66remove[] = "Remove an element from a set; it must be a member.\n If the element is not a member, raise a KeyError.\n ";
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_67remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem) {
int __pyx_v_elem;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("remove (wrapper)", 0);
assert(__pyx_arg_elem); {
__pyx_v_elem = __Pyx_PyInt_AsInt(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_AddTraceback("lib.intbitset.intbitset.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_66remove(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((int)__pyx_v_elem));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":654
* return ret
*
* def remove(self, int elem): # <<<<<<<<<<<<<<
* """Remove an element from a set; it must be a member.
* If the element is not a member, raise a KeyError.
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_66remove(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, int __pyx_v_elem) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("remove", 0);
/* "lib/intbitset.pyx":658
* If the element is not a member, raise a KeyError.
* """
* if self.sanity_checks: # <<<<<<<<<<<<<<
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
*/
if (__pyx_v_self->sanity_checks) {
/* "lib/intbitset.pyx":659
* """
* if self.sanity_checks:
* if elem < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
*/
__pyx_t_1 = (__pyx_v_elem < 0);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":660
* if self.sanity_checks:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_50), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __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 = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
/* "lib/intbitset.pyx":661
* if elem < 0:
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("Elements must be <= %s" % maxelem)
* if intBitSetIsInElem(self.bitset, elem):
*/
__pyx_t_1 = (__pyx_v_elem > maxelem);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":662
* raise ValueError("Negative numbers, not allowed")
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* if intBitSetIsInElem(self.bitset, elem):
* intBitSetDelElem(self.bitset, elem)
*/
__pyx_t_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __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 = 662; __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_OverflowError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __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 = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
__pyx_L4:;
goto __pyx_L3;
}
__pyx_L3:;
/* "lib/intbitset.pyx":663
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
* if intBitSetIsInElem(self.bitset, elem): # <<<<<<<<<<<<<<
* intBitSetDelElem(self.bitset, elem)
* else:
*/
__pyx_t_1 = intBitSetIsInElem(__pyx_v_self->bitset, __pyx_v_elem);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":664
* raise OverflowError("Elements must be <= %s" % maxelem)
* if intBitSetIsInElem(self.bitset, elem):
* intBitSetDelElem(self.bitset, elem) # <<<<<<<<<<<<<<
* else:
* raise KeyError(elem)
*/
intBitSetDelElem(__pyx_v_self->bitset, __pyx_v_elem);
goto __pyx_L5;
}
/*else*/ {
/* "lib/intbitset.pyx":666
* intBitSetDelElem(self.bitset, elem)
* else:
* raise KeyError(elem) # <<<<<<<<<<<<<<
*
* def strbits(self):
*/
__pyx_t_3 = PyInt_FromLong(__pyx_v_elem); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __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 = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __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 = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L5:;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("lib.intbitset.intbitset.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_69strbits(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_68strbits[] = "Return a string of 0s and 1s representing the content in memory\n of the intbitset.\n ";
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_69strbits(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("strbits (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_68strbits(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":668
* raise KeyError(elem)
*
* def strbits(self): # <<<<<<<<<<<<<<
* """Return a string of 0s and 1s representing the content in memory
* of the intbitset.
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_68strbits(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self) {
int __pyx_v_i;
int __pyx_v_last;
PyObject *__pyx_v_ret = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
PyObject *(*__pyx_t_3)(PyObject *);
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("strbits", 0);
/* "lib/intbitset.pyx":674
* cdef int i
* cdef int last
* if (<intbitset> self).bitset.trailing_bits: # <<<<<<<<<<<<<<
* raise OverflowError("It's impossible to print an infinite set.")
* last = 0
*/
if (__pyx_v_self->bitset->trailing_bits) {
/* "lib/intbitset.pyx":675
* cdef int last
* if (<intbitset> self).bitset.trailing_bits:
* raise OverflowError("It's impossible to print an infinite set.") # <<<<<<<<<<<<<<
* last = 0
* ret = []
*/
__pyx_t_1 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_k_tuple_52), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L3;
}
__pyx_L3:;
/* "lib/intbitset.pyx":676
* if (<intbitset> self).bitset.trailing_bits:
* raise OverflowError("It's impossible to print an infinite set.")
* last = 0 # <<<<<<<<<<<<<<
* ret = []
* for i in self:
*/
__pyx_v_last = 0;
/* "lib/intbitset.pyx":677
* raise OverflowError("It's impossible to print an infinite set.")
* last = 0
* ret = [] # <<<<<<<<<<<<<<
* for i in self:
* ret.append('0'*(i-last)+'1')
*/
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ret = __pyx_t_1;
__pyx_t_1 = 0;
/* "lib/intbitset.pyx":678
* last = 0
* ret = []
* for i in self: # <<<<<<<<<<<<<<
* ret.append('0'*(i-last)+'1')
* last = i+1
*/
if (PyList_CheckExact(((PyObject *)__pyx_v_self)) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) {
__pyx_t_1 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
__pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
for (;;) {
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 (!__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 {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_i = __pyx_t_5;
/* "lib/intbitset.pyx":679
* ret = []
* for i in self:
* ret.append('0'*(i-last)+'1') # <<<<<<<<<<<<<<
* last = i+1
* return ''.join(ret)
*/
__pyx_t_4 = PyInt_FromLong((__pyx_v_i - __pyx_v_last)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = PyNumber_Multiply(((PyObject *)__pyx_kp_s__0), __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_6));
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_6), ((PyObject *)__pyx_kp_s__1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
__pyx_t_7 = PyList_Append(__pyx_v_ret, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
/* "lib/intbitset.pyx":680
* for i in self:
* ret.append('0'*(i-last)+'1')
* last = i+1 # <<<<<<<<<<<<<<
* return ''.join(ret)
*
*/
__pyx_v_last = (__pyx_v_i + 1);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "lib/intbitset.pyx":681
* ret.append('0'*(i-last)+'1')
* last = i+1
* return ''.join(ret) # <<<<<<<<<<<<<<
*
* def update_with_signs(self, rhs):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_53), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_ret));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_ret));
__Pyx_GIVEREF(((PyObject *)__pyx_v_ret));
__pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 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_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("lib.intbitset.intbitset.strbits", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ret);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_71update_with_signs(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_70update_with_signs[] = "Given a dictionary rhs whose keys are integers, remove all the integers\n whose value are less than 0 and add every integer whose value is 0 or more";
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_71update_with_signs(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("update_with_signs (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_70update_with_signs(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":683
* return ''.join(ret)
*
* def update_with_signs(self, rhs): # <<<<<<<<<<<<<<
* """Given a dictionary rhs whose keys are integers, remove all the integers
* whose value are less than 0 and add every integer whose value is 0 or more"""
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_70update_with_signs(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, PyObject *__pyx_v_rhs) {
int __pyx_v_value;
PyObject *__pyx_v_sign = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
Py_ssize_t __pyx_t_6;
PyObject *(*__pyx_t_7)(PyObject *);
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *(*__pyx_t_11)(PyObject *);
int __pyx_t_12;
int __pyx_t_13;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("update_with_signs", 0);
/* "lib/intbitset.pyx":687
* whose value are less than 0 and add every integer whose value is 0 or more"""
* cdef int value
* try: # <<<<<<<<<<<<<<
* if self.sanity_checks:
* for value, sign in rhs.iteritems():
*/
{
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "lib/intbitset.pyx":688
* cdef int value
* try:
* if self.sanity_checks: # <<<<<<<<<<<<<<
* for value, sign in rhs.iteritems():
* if value < 0:
*/
if (__pyx_v_self->sanity_checks) {
/* "lib/intbitset.pyx":689
* try:
* if self.sanity_checks:
* for value, sign in rhs.iteritems(): # <<<<<<<<<<<<<<
* if value < 0:
* raise ValueError("Negative numbers, not allowed")
*/
__pyx_t_4 = PyObject_GetAttr(__pyx_v_rhs, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
__pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
__pyx_t_7 = NULL;
} else {
__pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
for (;;) {
if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_4)) {
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
__pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
} else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
} else {
__pyx_t_5 = __pyx_t_7(__pyx_t_4);
if (unlikely(!__pyx_t_5)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_5);
}
if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
PyObject* sequence = __pyx_t_5;
if (likely(PyTuple_CheckExact(sequence))) {
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 = 689; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
} else {
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 = 689; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
__pyx_t_8 = PyList_GET_ITEM(sequence, 0);
__pyx_t_9 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
__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 = 689; __pyx_clineno = __LINE__; goto __pyx_L3_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_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L14_unpacking_failed;
__Pyx_GOTREF(__pyx_t_8);
index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L14_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 = 689; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L15_unpacking_done;
__pyx_L14_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 = 689; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L15_unpacking_done:;
}
__pyx_t_12 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_value = __pyx_t_12;
__Pyx_XDECREF(__pyx_v_sign);
__pyx_v_sign = __pyx_t_9;
__pyx_t_9 = 0;
/* "lib/intbitset.pyx":690
* if self.sanity_checks:
* for value, sign in rhs.iteritems():
* if value < 0: # <<<<<<<<<<<<<<
* raise ValueError("Negative numbers, not allowed")
* elif value > maxelem:
*/
__pyx_t_13 = (__pyx_v_value < 0);
if (__pyx_t_13) {
/* "lib/intbitset.pyx":691
* for value, sign in rhs.iteritems():
* if value < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif value > maxelem:
* raise OverflowError("Elements must <= %s" % maxelem)
*/
__pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_54), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
goto __pyx_L16;
}
/* "lib/intbitset.pyx":692
* if value < 0:
* raise ValueError("Negative numbers, not allowed")
* elif value > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("Elements must <= %s" % maxelem)
* if sign < 0:
*/
__pyx_t_13 = (__pyx_v_value > maxelem);
if (__pyx_t_13) {
/* "lib/intbitset.pyx":693
* raise ValueError("Negative numbers, not allowed")
* elif value > maxelem:
* raise OverflowError("Elements must <= %s" % maxelem) # <<<<<<<<<<<<<<
* if sign < 0:
* intBitSetDelElem(self.bitset, value)
*/
__pyx_t_5 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_9));
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__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;
__pyx_t_9 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
goto __pyx_L16;
}
__pyx_L16:;
/* "lib/intbitset.pyx":694
* elif value > maxelem:
* raise OverflowError("Elements must <= %s" % maxelem)
* if sign < 0: # <<<<<<<<<<<<<<
* intBitSetDelElem(self.bitset, value)
* else:
*/
__pyx_t_9 = PyObject_RichCompare(__pyx_v_sign, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (__pyx_t_13) {
/* "lib/intbitset.pyx":695
* raise OverflowError("Elements must <= %s" % maxelem)
* if sign < 0:
* intBitSetDelElem(self.bitset, value) # <<<<<<<<<<<<<<
* else:
* intBitSetAddElem(self.bitset, value)
*/
intBitSetDelElem(__pyx_v_self->bitset, __pyx_v_value);
goto __pyx_L17;
}
/*else*/ {
/* "lib/intbitset.pyx":697
* intBitSetDelElem(self.bitset, value)
* else:
* intBitSetAddElem(self.bitset, value) # <<<<<<<<<<<<<<
* else:
* for value, sign in rhs.iteritems():
*/
intBitSetAddElem(__pyx_v_self->bitset, __pyx_v_value);
}
__pyx_L17:;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L11;
}
/*else*/ {
/* "lib/intbitset.pyx":699
* intBitSetAddElem(self.bitset, value)
* else:
* for value, sign in rhs.iteritems(): # <<<<<<<<<<<<<<
* if sign < 0:
* intBitSetDelElem(self.bitset, value)
*/
__pyx_t_4 = PyObject_GetAttr(__pyx_v_rhs, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_9 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) {
__pyx_t_4 = __pyx_t_9; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
__pyx_t_7 = NULL;
} else {
__pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
for (;;) {
if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_4)) {
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
__pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++;
} else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
__pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++;
} else {
__pyx_t_9 = __pyx_t_7(__pyx_t_4);
if (unlikely(!__pyx_t_9)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_9);
}
if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
PyObject* sequence = __pyx_t_9;
if (likely(PyTuple_CheckExact(sequence))) {
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 = 699; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
} else {
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 = 699; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
__pyx_t_5 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
index = 0; __pyx_t_5 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L20_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L20_unpacking_failed;
__Pyx_GOTREF(__pyx_t_8);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L21_unpacking_done;
__pyx_L20_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 = 699; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L21_unpacking_done:;
}
__pyx_t_12 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_value = __pyx_t_12;
__Pyx_XDECREF(__pyx_v_sign);
__pyx_v_sign = __pyx_t_8;
__pyx_t_8 = 0;
/* "lib/intbitset.pyx":700
* else:
* for value, sign in rhs.iteritems():
* if sign < 0: # <<<<<<<<<<<<<<
* intBitSetDelElem(self.bitset, value)
* else:
*/
__pyx_t_9 = PyObject_RichCompare(__pyx_v_sign, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (__pyx_t_13) {
/* "lib/intbitset.pyx":701
* for value, sign in rhs.iteritems():
* if sign < 0:
* intBitSetDelElem(self.bitset, value) # <<<<<<<<<<<<<<
* else:
* intBitSetAddElem(self.bitset, value)
*/
intBitSetDelElem(__pyx_v_self->bitset, __pyx_v_value);
goto __pyx_L22;
}
/*else*/ {
/* "lib/intbitset.pyx":703
* intBitSetDelElem(self.bitset, value)
* else:
* intBitSetAddElem(self.bitset, value) # <<<<<<<<<<<<<<
* except AttributeError:
* raise TypeError("rhs should be a valid dictionary with integers keys and integer values")
*/
intBitSetAddElem(__pyx_v_self->bitset, __pyx_v_value);
}
__pyx_L22:;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__pyx_L11:;
}
__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_L10_try_end;
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "lib/intbitset.pyx":704
* else:
* intBitSetAddElem(self.bitset, value)
* except AttributeError: # <<<<<<<<<<<<<<
* raise TypeError("rhs should be a valid dictionary with integers keys and integer values")
*
*/
__pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_t_12) {
__Pyx_AddTraceback("lib.intbitset.intbitset.update_with_signs", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GOTREF(__pyx_t_8);
/* "lib/intbitset.pyx":705
* intBitSetAddElem(self.bitset, value)
* except AttributeError:
* raise TypeError("rhs should be a valid dictionary with integers keys and integer values") # <<<<<<<<<<<<<<
*
* def get_size(self):
*/
__pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_57), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L4_exception_handled;
}
__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_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_L10_try_end:;
}
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("lib.intbitset.intbitset.update_with_signs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_sign);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_73get_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_73get_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_size (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_72get_size(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":707
* raise TypeError("rhs should be a valid dictionary with integers keys and integer values")
*
* def get_size(self): # <<<<<<<<<<<<<<
* return intBitSetGetSize(self.bitset)
*
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_72get_size(struct __pyx_obj_3lib_9intbitset_intbitset *__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("get_size", 0);
/* "lib/intbitset.pyx":708
*
* def get_size(self):
* return intBitSetGetSize(self.bitset) # <<<<<<<<<<<<<<
*
* def get_allocated(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyInt_FromLong(intBitSetGetSize(__pyx_v_self->bitset)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __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("lib.intbitset.intbitset.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_75get_allocated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_75get_allocated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_allocated (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_74get_allocated(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":710
* return intBitSetGetSize(self.bitset)
*
* def get_allocated(self): # <<<<<<<<<<<<<<
* return intBitSetGetAllocated(self.bitset)
*
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_74get_allocated(struct __pyx_obj_3lib_9intbitset_intbitset *__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("get_allocated", 0);
/* "lib/intbitset.pyx":711
*
* def get_allocated(self):
* return intBitSetGetAllocated(self.bitset) # <<<<<<<<<<<<<<
*
* def is_infinite(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyInt_FromLong(intBitSetGetAllocated(__pyx_v_self->bitset)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __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("lib.intbitset.intbitset.get_allocated", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_77is_infinite(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_76is_infinite[] = "Return True if the intbitset is infinite. (i.e. trailing_bits=True\n was used in the constructor.)";
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_77is_infinite(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("is_infinite (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_76is_infinite(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":713
* return intBitSetGetAllocated(self.bitset)
*
* def is_infinite(self): # <<<<<<<<<<<<<<
* """Return True if the intbitset is infinite. (i.e. trailing_bits=True
* was used in the constructor.)"""
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_76is_infinite(struct __pyx_obj_3lib_9intbitset_intbitset *__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("is_infinite", 0);
/* "lib/intbitset.pyx":716
* """Return True if the intbitset is infinite. (i.e. trailing_bits=True
* was used in the constructor.)"""
* return self.bitset.trailing_bits != 0 # <<<<<<<<<<<<<<
*
* def extract_finite_list(self, int up_to=-1):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->bitset->trailing_bits != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __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("lib.intbitset.intbitset.is_infinite", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_79extract_finite_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_78extract_finite_list[] = "Return a finite list of elements sufficient to be passed to intbitset\n constructor toghether with the proper value of trailing_bits in order\n to reproduce this intbitset. At least up_to integer are looked for when\n they are inside the intbitset but not necessarily needed to build the\n intbitset";
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_79extract_finite_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_up_to;
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__up_to,0};
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("extract_finite_list (wrapper)", 0);
{
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_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 (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__up_to);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract_finite_list") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
if (values[0]) {
} else {
__pyx_v_up_to = ((int)-1);
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
if (values[0]) {
__pyx_v_up_to = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_up_to == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_up_to = ((int)-1);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("extract_finite_list", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("lib.intbitset.intbitset.extract_finite_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_78extract_finite_list(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self), __pyx_v_up_to);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":718
* return self.bitset.trailing_bits != 0
*
* def extract_finite_list(self, int up_to=-1): # <<<<<<<<<<<<<<
* """Return a finite list of elements sufficient to be passed to intbitset
* constructor toghether with the proper value of trailing_bits in order
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_78extract_finite_list(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self, int __pyx_v_up_to) {
int __pyx_v_true_up_to;
int __pyx_v_last;
PyObject *__pyx_v_ret = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
int __pyx_t_7;
int __pyx_t_8;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extract_finite_list", 0);
/* "lib/intbitset.pyx":726
* cdef int true_up_to
* cdef int last
* if self.sanity_checks and up_to > maxelem: # <<<<<<<<<<<<<<
* raise OverflowError("up_to must be <= %s" % maxelem)
* ret = []
*/
if (__pyx_v_self->sanity_checks) {
__pyx_t_1 = (__pyx_v_up_to > maxelem);
__pyx_t_2 = __pyx_t_1;
} else {
__pyx_t_2 = __pyx_v_self->sanity_checks;
}
if (__pyx_t_2) {
/* "lib/intbitset.pyx":727
* cdef int last
* if self.sanity_checks and up_to > maxelem:
* raise OverflowError("up_to must be <= %s" % maxelem) # <<<<<<<<<<<<<<
* ret = []
* true_up_to = max(up_to, (intBitSetGetSize(self.bitset)) * wordbitsize)
*/
__pyx_t_3 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_58), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
__pyx_t_4 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L3;
}
__pyx_L3:;
/* "lib/intbitset.pyx":728
* if self.sanity_checks and up_to > maxelem:
* raise OverflowError("up_to must be <= %s" % maxelem)
* ret = [] # <<<<<<<<<<<<<<
* true_up_to = max(up_to, (intBitSetGetSize(self.bitset)) * wordbitsize)
* last = -1
*/
__pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_ret = __pyx_t_4;
__pyx_t_4 = 0;
/* "lib/intbitset.pyx":729
* raise OverflowError("up_to must be <= %s" % maxelem)
* ret = []
* true_up_to = max(up_to, (intBitSetGetSize(self.bitset)) * wordbitsize) # <<<<<<<<<<<<<<
* last = -1
* while last < true_up_to:
*/
__pyx_t_5 = (intBitSetGetSize(__pyx_v_self->bitset) * wordbitsize);
__pyx_t_6 = __pyx_v_up_to;
if ((__pyx_t_5 > __pyx_t_6)) {
__pyx_t_7 = __pyx_t_5;
} else {
__pyx_t_7 = __pyx_t_6;
}
__pyx_v_true_up_to = __pyx_t_7;
/* "lib/intbitset.pyx":730
* ret = []
* true_up_to = max(up_to, (intBitSetGetSize(self.bitset)) * wordbitsize)
* last = -1 # <<<<<<<<<<<<<<
* while last < true_up_to:
* last = intBitSetGetNext(self.bitset, last)
*/
__pyx_v_last = -1;
/* "lib/intbitset.pyx":731
* true_up_to = max(up_to, (intBitSetGetSize(self.bitset)) * wordbitsize)
* last = -1
* while last < true_up_to: # <<<<<<<<<<<<<<
* last = intBitSetGetNext(self.bitset, last)
* if last == -2:
*/
while (1) {
__pyx_t_2 = (__pyx_v_last < __pyx_v_true_up_to);
if (!__pyx_t_2) break;
/* "lib/intbitset.pyx":732
* last = -1
* while last < true_up_to:
* last = intBitSetGetNext(self.bitset, last) # <<<<<<<<<<<<<<
* if last == -2:
* break
*/
__pyx_v_last = intBitSetGetNext(__pyx_v_self->bitset, __pyx_v_last);
/* "lib/intbitset.pyx":733
* while last < true_up_to:
* last = intBitSetGetNext(self.bitset, last)
* if last == -2: # <<<<<<<<<<<<<<
* break
* ret.append(last)
*/
__pyx_t_2 = (__pyx_v_last == -2);
if (__pyx_t_2) {
/* "lib/intbitset.pyx":734
* last = intBitSetGetNext(self.bitset, last)
* if last == -2:
* break # <<<<<<<<<<<<<<
* ret.append(last)
* return ret
*/
goto __pyx_L5_break;
goto __pyx_L6;
}
__pyx_L6:;
/* "lib/intbitset.pyx":735
* if last == -2:
* break
* ret.append(last) # <<<<<<<<<<<<<<
* return ret
*
*/
__pyx_t_4 = PyInt_FromLong(__pyx_v_last); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_8 = PyList_Append(__pyx_v_ret, __pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__pyx_L5_break:;
/* "lib/intbitset.pyx":736
* break
* ret.append(last)
* return ret # <<<<<<<<<<<<<<
*
* def get_wordbitsize(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ret));
__pyx_r = ((PyObject *)__pyx_v_ret);
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("lib.intbitset.intbitset.extract_finite_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ret);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_81get_wordbitsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_81get_wordbitsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_wordbitsize (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_80get_wordbitsize(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":738
* return ret
*
* def get_wordbitsize(self): # <<<<<<<<<<<<<<
* return wordbitsize
*
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_80get_wordbitsize(CYTHON_UNUSED struct __pyx_obj_3lib_9intbitset_intbitset *__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("get_wordbitsize", 0);
/* "lib/intbitset.pyx":739
*
* def get_wordbitsize(self):
* return wordbitsize # <<<<<<<<<<<<<<
*
* def get_wordbytsize(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyInt_FromLong(wordbitsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __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("lib.intbitset.intbitset.get_wordbitsize", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_83get_wordbytsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_83get_wordbytsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_wordbytsize (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_82get_wordbytsize(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":741
* return wordbitsize
*
* def get_wordbytsize(self): # <<<<<<<<<<<<<<
* return wordbytesize
*
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_82get_wordbytsize(CYTHON_UNUSED struct __pyx_obj_3lib_9intbitset_intbitset *__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("get_wordbytsize", 0);
/* "lib/intbitset.pyx":742
*
* def get_wordbytsize(self):
* return wordbytesize # <<<<<<<<<<<<<<
*
* def tolist(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyInt_FromLong(wordbytesize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __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("lib.intbitset.intbitset.get_wordbytsize", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_85tolist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3lib_9intbitset_9intbitset_84tolist[] = "Legacy method to retrieve a list of all the elements inside an\n intbitset.\n ";
static PyObject *__pyx_pw_3lib_9intbitset_9intbitset_85tolist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("tolist (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_9intbitset_84tolist(((struct __pyx_obj_3lib_9intbitset_intbitset *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":744
* return wordbytesize
*
* def tolist(self): # <<<<<<<<<<<<<<
* """Legacy method to retrieve a list of all the elements inside an
* intbitset.
*/
static PyObject *__pyx_pf_3lib_9intbitset_9intbitset_84tolist(struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("tolist", 0);
/* "lib/intbitset.pyx":748
* intbitset.
* """
* if self.bitset.trailing_bits: # <<<<<<<<<<<<<<
* raise OverflowError("It's impossible to retrieve a list of an infinite set")
* return self.extract_finite_list()
*/
if (__pyx_v_self->bitset->trailing_bits) {
/* "lib/intbitset.pyx":749
* """
* if self.bitset.trailing_bits:
* raise OverflowError("It's impossible to retrieve a list of an infinite set") # <<<<<<<<<<<<<<
* return self.extract_finite_list()
*
*/
__pyx_t_1 = PyObject_Call(__pyx_builtin_OverflowError, ((PyObject *)__pyx_k_tuple_60), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L3;
}
__pyx_L3:;
/* "lib/intbitset.pyx":750
* if self.bitset.trailing_bits:
* raise OverflowError("It's impossible to retrieve a list of an infinite set")
* return self.extract_finite_list() # <<<<<<<<<<<<<<
*
* cdef object __weakref__
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__extract_finite_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __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 = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__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("lib.intbitset.intbitset.tolist", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_3lib_9intbitset_18intbitset_iterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3lib_9intbitset_18intbitset_iterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_bitset = 0;
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__bitset,0};
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
{
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_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 (pos_args) {
case 0:
values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bitset);
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, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_bitset = ((struct __pyx_obj_3lib_9intbitset_intbitset *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("lib.intbitset.intbitset_iterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bitset), __pyx_ptype_3lib_9intbitset_intbitset, 0, "bitset", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3lib_9intbitset_18intbitset_iterator___cinit__(((struct __pyx_obj_3lib_9intbitset_intbitset_iterator *)__pyx_v_self), __pyx_v_bitset);
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":759
* cdef bint sanity_checks
*
* def __cinit__(self, intbitset bitset not None): # <<<<<<<<<<<<<<
* #print >> sys.stderr, "intbitset_iterator.__cinit__ is called"
* self.last = -1
*/
static int __pyx_pf_3lib_9intbitset_18intbitset_iterator___cinit__(struct __pyx_obj_3lib_9intbitset_intbitset_iterator *__pyx_v_self, struct __pyx_obj_3lib_9intbitset_intbitset *__pyx_v_bitset) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "lib/intbitset.pyx":761
* def __cinit__(self, intbitset bitset not None):
* #print >> sys.stderr, "intbitset_iterator.__cinit__ is called"
* self.last = -1 # <<<<<<<<<<<<<<
* ## A copy should be performed, in case the original bitset disappears
* ## as in "for x in intbitset([1,2,3])"!
*/
__pyx_v_self->last = -1;
/* "lib/intbitset.pyx":764
* ## A copy should be performed, in case the original bitset disappears
* ## as in "for x in intbitset([1,2,3])"!
* self.bitset = intBitSetClone(bitset.bitset) # <<<<<<<<<<<<<<
* self.sanity_checks = CFG_INTBITSET_ENABLE_SANITY_CHECKS
*
*/
__pyx_v_self->bitset = intBitSetClone(__pyx_v_bitset->bitset);
/* "lib/intbitset.pyx":765
* ## as in "for x in intbitset([1,2,3])"!
* self.bitset = intBitSetClone(bitset.bitset)
* self.sanity_checks = CFG_INTBITSET_ENABLE_SANITY_CHECKS # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_61); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_self->sanity_checks = __pyx_t_2;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("lib.intbitset.intbitset_iterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static void __pyx_pw_3lib_9intbitset_18intbitset_iterator_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_3lib_9intbitset_18intbitset_iterator_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__pyx_pf_3lib_9intbitset_18intbitset_iterator_2__dealloc__(((struct __pyx_obj_3lib_9intbitset_intbitset_iterator *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
}
/* "lib/intbitset.pyx":767
* self.sanity_checks = CFG_INTBITSET_ENABLE_SANITY_CHECKS
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* #print >> sys.stderr, "intbitset_iterator.__dealloc__ is called"
* intBitSetDestroy(self.bitset)
*/
static void __pyx_pf_3lib_9intbitset_18intbitset_iterator_2__dealloc__(struct __pyx_obj_3lib_9intbitset_intbitset_iterator *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "lib/intbitset.pyx":769
* def __dealloc__(self):
* #print >> sys.stderr, "intbitset_iterator.__dealloc__ is called"
* intBitSetDestroy(self.bitset) # <<<<<<<<<<<<<<
*
* def __next__(self):
*/
intBitSetDestroy(__pyx_v_self->bitset);
__Pyx_RefNannyFinishContext();
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_18intbitset_iterator_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_18intbitset_iterator_5__next__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_18intbitset_iterator_4__next__(((struct __pyx_obj_3lib_9intbitset_intbitset_iterator *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":771
* intBitSetDestroy(self.bitset)
*
* def __next__(self): # <<<<<<<<<<<<<<
* if self.last == -2:
* raise StopIteration()
*/
static PyObject *__pyx_pf_3lib_9intbitset_18intbitset_iterator_4__next__(struct __pyx_obj_3lib_9intbitset_intbitset_iterator *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__next__", 0);
/* "lib/intbitset.pyx":772
*
* def __next__(self):
* if self.last == -2: # <<<<<<<<<<<<<<
* raise StopIteration()
* self.last = intBitSetGetNext(self.bitset, self.last)
*/
__pyx_t_1 = (__pyx_v_self->last == -2);
if (__pyx_t_1) {
/* "lib/intbitset.pyx":773
* def __next__(self):
* if self.last == -2:
* raise StopIteration() # <<<<<<<<<<<<<<
* self.last = intBitSetGetNext(self.bitset, self.last)
* if self.sanity_checks and (self.bitset.allocated < self.bitset.size):
*/
__pyx_t_2 = PyObject_Call(__pyx_builtin_StopIteration, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __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 = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L3;
}
__pyx_L3:;
/* "lib/intbitset.pyx":774
* if self.last == -2:
* raise StopIteration()
* self.last = intBitSetGetNext(self.bitset, self.last) # <<<<<<<<<<<<<<
* if self.sanity_checks and (self.bitset.allocated < self.bitset.size):
* raise MemoryError("intbitset corrupted: allocated: %s, size: %s" % (self.bitset.allocated, self.bitset.size))
*/
__pyx_v_self->last = intBitSetGetNext(__pyx_v_self->bitset, __pyx_v_self->last);
/* "lib/intbitset.pyx":775
* raise StopIteration()
* self.last = intBitSetGetNext(self.bitset, self.last)
* if self.sanity_checks and (self.bitset.allocated < self.bitset.size): # <<<<<<<<<<<<<<
* raise MemoryError("intbitset corrupted: allocated: %s, size: %s" % (self.bitset.allocated, self.bitset.size))
* if self.last < 0:
*/
if (__pyx_v_self->sanity_checks) {
__pyx_t_1 = (__pyx_v_self->bitset->allocated < __pyx_v_self->bitset->size);
__pyx_t_3 = __pyx_t_1;
} else {
__pyx_t_3 = __pyx_v_self->sanity_checks;
}
if (__pyx_t_3) {
/* "lib/intbitset.pyx":776
* self.last = intBitSetGetNext(self.bitset, self.last)
* if self.sanity_checks and (self.bitset.allocated < self.bitset.size):
* raise MemoryError("intbitset corrupted: allocated: %s, size: %s" % (self.bitset.allocated, self.bitset.size)) # <<<<<<<<<<<<<<
* if self.last < 0:
* self.last = -2
*/
__pyx_t_2 = PyInt_FromLong(__pyx_v_self->bitset->allocated); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = PyInt_FromLong(__pyx_v_self->bitset->size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __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 = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_2 = 0;
__pyx_t_4 = 0;
__pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
__pyx_t_4 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 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 = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
__pyx_L4:;
/* "lib/intbitset.pyx":777
* if self.sanity_checks and (self.bitset.allocated < self.bitset.size):
* raise MemoryError("intbitset corrupted: allocated: %s, size: %s" % (self.bitset.allocated, self.bitset.size))
* if self.last < 0: # <<<<<<<<<<<<<<
* self.last = -2
* raise StopIteration()
*/
__pyx_t_3 = (__pyx_v_self->last < 0);
if (__pyx_t_3) {
/* "lib/intbitset.pyx":778
* raise MemoryError("intbitset corrupted: allocated: %s, size: %s" % (self.bitset.allocated, self.bitset.size))
* if self.last < 0:
* self.last = -2 # <<<<<<<<<<<<<<
* raise StopIteration()
* return self.last
*/
__pyx_v_self->last = -2;
/* "lib/intbitset.pyx":779
* if self.last < 0:
* self.last = -2
* raise StopIteration() # <<<<<<<<<<<<<<
* return self.last
*
*/
__pyx_t_4 = PyObject_Call(__pyx_builtin_StopIteration, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L5;
}
__pyx_L5:;
/* "lib/intbitset.pyx":780
* self.last = -2
* raise StopIteration()
* return self.last # <<<<<<<<<<<<<<
*
* def __iter__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = PyInt_FromLong(__pyx_v_self->last); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("lib.intbitset.intbitset_iterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_3lib_9intbitset_18intbitset_iterator_7__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3lib_9intbitset_18intbitset_iterator_7__iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
__pyx_r = __pyx_pf_3lib_9intbitset_18intbitset_iterator_6__iter__(((struct __pyx_obj_3lib_9intbitset_intbitset_iterator *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "lib/intbitset.pyx":782
* return self.last
*
* def __iter__(self): # <<<<<<<<<<<<<<
* return self
*
*/
static PyObject *__pyx_pf_3lib_9intbitset_18intbitset_iterator_6__iter__(struct __pyx_obj_3lib_9intbitset_intbitset_iterator *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
/* "lib/intbitset.pyx":783
*
* def __iter__(self):
* return self # <<<<<<<<<<<<<<
*
* cdef object __weakref__
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_tp_new_3lib_9intbitset_intbitset(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_3lib_9intbitset_intbitset *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_3lib_9intbitset_intbitset *)o);
p->__weakref__ = 0;
if (__pyx_pw_3lib_9intbitset_9intbitset_1__cinit__(o, a, k) < 0) {
Py_DECREF(o); o = 0;
}
return o;
}
static void __pyx_tp_dealloc_3lib_9intbitset_intbitset(PyObject *o) {
struct __pyx_obj_3lib_9intbitset_intbitset *p = (struct __pyx_obj_3lib_9intbitset_intbitset *)o;
{
PyObject *etype, *eval, *etb;
PyErr_Fetch(&etype, &eval, &etb);
++Py_REFCNT(o);
__pyx_pw_3lib_9intbitset_9intbitset_3__dealloc__(o);
if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
--Py_REFCNT(o);
PyErr_Restore(etype, eval, etb);
}
if (p->__weakref__) PyObject_ClearWeakRefs(o);
Py_XDECREF(p->__weakref__);
(*Py_TYPE(o)->tp_free)(o);
}
static int __pyx_tp_traverse_3lib_9intbitset_intbitset(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_3lib_9intbitset_intbitset *p = (struct __pyx_obj_3lib_9intbitset_intbitset *)o;
if (p->__weakref__) {
e = (*v)(p->__weakref__, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_3lib_9intbitset_intbitset(PyObject *o) {
return 0;
}
static PyObject *__pyx_sq_item_3lib_9intbitset_intbitset(PyObject *o, Py_ssize_t i) {
PyObject *r;
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
Py_DECREF(x);
return r;
}
static PyMethodDef __pyx_methods_3lib_9intbitset_intbitset[] = {
{__Pyx_NAMESTR("__deepcopy__"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_21__deepcopy__, METH_O, __Pyx_DOCSTR(0)},
{__Pyx_NAMESTR("__del__"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_23__del__, METH_O, __Pyx_DOCSTR(0)},
{__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_45__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)},
{__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_49add, METH_O, __Pyx_DOCSTR(__pyx_doc_3lib_9intbitset_9intbitset_48add)},
{__Pyx_NAMESTR("clear"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_51clear, METH_NOARGS, __Pyx_DOCSTR(0)},
{__Pyx_NAMESTR("discard"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_53discard, METH_O, __Pyx_DOCSTR(__pyx_doc_3lib_9intbitset_9intbitset_52discard)},
{__Pyx_NAMESTR("issubset"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_55issubset, METH_O, __Pyx_DOCSTR(__pyx_doc_3lib_9intbitset_9intbitset_54issubset)},
{__Pyx_NAMESTR("issuperset"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_57issuperset, METH_O, __Pyx_DOCSTR(__pyx_doc_3lib_9intbitset_9intbitset_56issuperset)},
{__Pyx_NAMESTR("fastdump"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_59fastdump, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3lib_9intbitset_9intbitset_58fastdump)},
{__Pyx_NAMESTR("fastload"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_61fastload, METH_O, __Pyx_DOCSTR(__pyx_doc_3lib_9intbitset_9intbitset_60fastload)},
{__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_63copy, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3lib_9intbitset_9intbitset_62copy)},
{__Pyx_NAMESTR("pop"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_65pop, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3lib_9intbitset_9intbitset_64pop)},
{__Pyx_NAMESTR("remove"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_67remove, METH_O, __Pyx_DOCSTR(__pyx_doc_3lib_9intbitset_9intbitset_66remove)},
{__Pyx_NAMESTR("strbits"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_69strbits, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3lib_9intbitset_9intbitset_68strbits)},
{__Pyx_NAMESTR("update_with_signs"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_71update_with_signs, METH_O, __Pyx_DOCSTR(__pyx_doc_3lib_9intbitset_9intbitset_70update_with_signs)},
{__Pyx_NAMESTR("get_size"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_73get_size, METH_NOARGS, __Pyx_DOCSTR(0)},
{__Pyx_NAMESTR("get_allocated"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_75get_allocated, METH_NOARGS, __Pyx_DOCSTR(0)},
{__Pyx_NAMESTR("is_infinite"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_77is_infinite, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3lib_9intbitset_9intbitset_76is_infinite)},
{__Pyx_NAMESTR("extract_finite_list"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_79extract_finite_list, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3lib_9intbitset_9intbitset_78extract_finite_list)},
{__Pyx_NAMESTR("get_wordbitsize"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_81get_wordbitsize, METH_NOARGS, __Pyx_DOCSTR(0)},
{__Pyx_NAMESTR("get_wordbytsize"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_83get_wordbytsize, METH_NOARGS, __Pyx_DOCSTR(0)},
{__Pyx_NAMESTR("tolist"), (PyCFunction)__pyx_pw_3lib_9intbitset_9intbitset_85tolist, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3lib_9intbitset_9intbitset_84tolist)},
{0, 0, 0, 0}
};
static PyNumberMethods __pyx_tp_as_number_intbitset = {
0, /*nb_add*/
__pyx_pw_3lib_9intbitset_9intbitset_31__sub__, /*nb_subtract*/
0, /*nb_multiply*/
#if PY_MAJOR_VERSION < 3
0, /*nb_divide*/
#endif
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
__pyx_pw_3lib_9intbitset_9intbitset_15__nonzero__, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
__pyx_pw_3lib_9intbitset_9intbitset_25__and__, /*nb_and*/
__pyx_pw_3lib_9intbitset_9intbitset_29__xor__, /*nb_xor*/
__pyx_pw_3lib_9intbitset_9intbitset_27__or__, /*nb_or*/
#if PY_MAJOR_VERSION < 3
0, /*nb_coerce*/
#endif
0, /*nb_int*/
#if PY_MAJOR_VERSION < 3
0, /*nb_long*/
#else
0, /*reserved*/
#endif
0, /*nb_float*/
#if PY_MAJOR_VERSION < 3
0, /*nb_oct*/
#endif
#if PY_MAJOR_VERSION < 3
0, /*nb_hex*/
#endif
__pyx_pw_3lib_9intbitset_9intbitset_17__iadd__, /*nb_inplace_add*/
__pyx_pw_3lib_9intbitset_9intbitset_19__isub__, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
#if PY_MAJOR_VERSION < 3
0, /*nb_inplace_divide*/
#endif
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
__pyx_pw_3lib_9intbitset_9intbitset_33__iand__, /*nb_inplace_and*/
__pyx_pw_3lib_9intbitset_9intbitset_37__ixor__, /*nb_inplace_xor*/
__pyx_pw_3lib_9intbitset_9intbitset_35__ior__, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if PY_VERSION_HEX >= 0x02050000
0, /*nb_index*/
#endif
};
static PySequenceMethods __pyx_tp_as_sequence_intbitset = {
__pyx_pw_3lib_9intbitset_9intbitset_11__len__, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_3lib_9intbitset_intbitset, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
__pyx_pw_3lib_9intbitset_9intbitset_5__contains__, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};
static PyMappingMethods __pyx_tp_as_mapping_intbitset = {
__pyx_pw_3lib_9intbitset_9intbitset_11__len__, /*mp_length*/
__pyx_pw_3lib_9intbitset_9intbitset_43__getitem__, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
static PyBufferProcs __pyx_tp_as_buffer_intbitset = {
#if PY_MAJOR_VERSION < 3
0, /*bf_getreadbuffer*/
#endif
#if PY_MAJOR_VERSION < 3
0, /*bf_getwritebuffer*/
#endif
#if PY_MAJOR_VERSION < 3
0, /*bf_getsegcount*/
#endif
#if PY_MAJOR_VERSION < 3
0, /*bf_getcharbuffer*/
#endif
#if PY_VERSION_HEX >= 0x02060000
0, /*bf_getbuffer*/
#endif
#if PY_VERSION_HEX >= 0x02060000
0, /*bf_releasebuffer*/
#endif
};
static PyTypeObject __pyx_type_3lib_9intbitset_intbitset = {
PyVarObject_HEAD_INIT(0, 0)
__Pyx_NAMESTR("lib.intbitset.intbitset"), /*tp_name*/
sizeof(struct __pyx_obj_3lib_9intbitset_intbitset), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_3lib_9intbitset_intbitset, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
__pyx_pw_3lib_9intbitset_9intbitset_7__cmp__, /*tp_compare*/
#else
0, /*reserved*/
#endif
__pyx_pw_3lib_9intbitset_9intbitset_39__repr__, /*tp_repr*/
&__pyx_tp_as_number_intbitset, /*tp_as_number*/
&__pyx_tp_as_sequence_intbitset, /*tp_as_sequence*/
&__pyx_tp_as_mapping_intbitset, /*tp_as_mapping*/
__pyx_pw_3lib_9intbitset_9intbitset_13__hash__, /*tp_hash*/
0, /*tp_call*/
__pyx_pw_3lib_9intbitset_9intbitset_41__str__, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_intbitset, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
__Pyx_DOCSTR("\n Defines an intbitset data object to hold unordered sets of\n unsigned integers with ultra fast set operations, implemented via\n bit vectors and Python C extension to optimize speed and memory\n usage.\n\n Emulates the Python built-in set class interface with some\n additional specific methods such as its own fast dump and load\n marshalling functions. Uses real bits to optimize memory usage,\n so may have issues with endianness if you transport serialized\n bitsets between various machine architectures.\n\n The constructor accept the following parameters:\n rhs=0, int preallocate=-1, int trailing_bits=0,\n bint sanity_checks=CFG_INTBITSET_ENABLE_SANITY_CHECKS,\n int no_allocate=0:\n\n where:\n * rhs can be:\n - int/long for creating allocating empty intbitset that will hold at least\n rhs elements, before being resized\n - intbitset for cloning\n - str for retrieving an intbitset that was dumped into a string\n - array for retrieving an intbitset that was dumped into a string stored\n in an array\n - sequence made of integers for copying all the elements from the\n sequence. If minsize is specified than it is initially allocated\n enough space to hold up to minsize integers, otherwise the biggest\n element of the sequence will be used.\n - sequence made of tuples: then the first element of each tuple\n is considered as an integer (as in the sequence made of integers).\n * preallocate is a suggested initial upper bound on the numbers that will be\n stored, by looking at rhs a sequence of number.\n * trailing_bits is 1, then the set will contain \"all\" the positive integers\n * no_allocate is used internally and should never be set.\n after the biggest one added with rhs.\n "), /*tp_doc*/
__pyx_tp_traverse_3lib_9intbitset_intbitset, /*tp_traverse*/
__pyx_tp_clear_3lib_9intbitset_intbitset, /*tp_clear*/
__pyx_pw_3lib_9intbitset_9intbitset_9__richcmp__, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pw_3lib_9intbitset_9intbitset_47__iter__, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_3lib_9intbitset_intbitset, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_3lib_9intbitset_intbitset, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
#if PY_VERSION_HEX >= 0x02060000
0, /*tp_version_tag*/
#endif
};
static PyObject *__pyx_tp_new_3lib_9intbitset_intbitset_iterator(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_3lib_9intbitset_intbitset_iterator *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_3lib_9intbitset_intbitset_iterator *)o);
p->__weakref__ = 0;
if (__pyx_pw_3lib_9intbitset_18intbitset_iterator_1__cinit__(o, a, k) < 0) {
Py_DECREF(o); o = 0;
}
return o;
}
static void __pyx_tp_dealloc_3lib_9intbitset_intbitset_iterator(PyObject *o) {
struct __pyx_obj_3lib_9intbitset_intbitset_iterator *p = (struct __pyx_obj_3lib_9intbitset_intbitset_iterator *)o;
{
PyObject *etype, *eval, *etb;
PyErr_Fetch(&etype, &eval, &etb);
++Py_REFCNT(o);
__pyx_pw_3lib_9intbitset_18intbitset_iterator_3__dealloc__(o);
if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
--Py_REFCNT(o);
PyErr_Restore(etype, eval, etb);
}
if (p->__weakref__) PyObject_ClearWeakRefs(o);
Py_XDECREF(p->__weakref__);
(*Py_TYPE(o)->tp_free)(o);
}
static int __pyx_tp_traverse_3lib_9intbitset_intbitset_iterator(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_3lib_9intbitset_intbitset_iterator *p = (struct __pyx_obj_3lib_9intbitset_intbitset_iterator *)o;
if (p->__weakref__) {
e = (*v)(p->__weakref__, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_3lib_9intbitset_intbitset_iterator(PyObject *o) {
return 0;
}
static PyMethodDef __pyx_methods_3lib_9intbitset_intbitset_iterator[] = {
{__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_3lib_9intbitset_18intbitset_iterator_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
{0, 0, 0, 0}
};
static PyNumberMethods __pyx_tp_as_number_intbitset_iterator = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
#if PY_MAJOR_VERSION < 3
0, /*nb_divide*/
#endif
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
#if PY_MAJOR_VERSION < 3
0, /*nb_coerce*/
#endif
0, /*nb_int*/
#if PY_MAJOR_VERSION < 3
0, /*nb_long*/
#else
0, /*reserved*/
#endif
0, /*nb_float*/
#if PY_MAJOR_VERSION < 3
0, /*nb_oct*/
#endif
#if PY_MAJOR_VERSION < 3
0, /*nb_hex*/
#endif
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
#if PY_MAJOR_VERSION < 3
0, /*nb_inplace_divide*/
#endif
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if PY_VERSION_HEX >= 0x02050000
0, /*nb_index*/
#endif
};
static PySequenceMethods __pyx_tp_as_sequence_intbitset_iterator = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};
static PyMappingMethods __pyx_tp_as_mapping_intbitset_iterator = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
static PyBufferProcs __pyx_tp_as_buffer_intbitset_iterator = {
#if PY_MAJOR_VERSION < 3
0, /*bf_getreadbuffer*/
#endif
#if PY_MAJOR_VERSION < 3
0, /*bf_getwritebuffer*/
#endif
#if PY_MAJOR_VERSION < 3
0, /*bf_getsegcount*/
#endif
#if PY_MAJOR_VERSION < 3
0, /*bf_getcharbuffer*/
#endif
#if PY_VERSION_HEX >= 0x02060000
0, /*bf_getbuffer*/
#endif
#if PY_VERSION_HEX >= 0x02060000
0, /*bf_releasebuffer*/
#endif
};
static PyTypeObject __pyx_type_3lib_9intbitset_intbitset_iterator = {
PyVarObject_HEAD_INIT(0, 0)
__Pyx_NAMESTR("lib.intbitset.intbitset_iterator"), /*tp_name*/
sizeof(struct __pyx_obj_3lib_9intbitset_intbitset_iterator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_3lib_9intbitset_intbitset_iterator, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#else
0, /*reserved*/
#endif
0, /*tp_repr*/
&__pyx_tp_as_number_intbitset_iterator, /*tp_as_number*/
&__pyx_tp_as_sequence_intbitset_iterator, /*tp_as_sequence*/
&__pyx_tp_as_mapping_intbitset_iterator, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_intbitset_iterator, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_3lib_9intbitset_intbitset_iterator, /*tp_traverse*/
__pyx_tp_clear_3lib_9intbitset_intbitset_iterator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pw_3lib_9intbitset_18intbitset_iterator_7__iter__, /*tp_iter*/
__pyx_pw_3lib_9intbitset_18intbitset_iterator_5__next__, /*tp_iternext*/
__pyx_methods_3lib_9intbitset_intbitset_iterator, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_3lib_9intbitset_intbitset_iterator, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
#if PY_VERSION_HEX >= 0x02060000
0, /*tp_version_tag*/
#endif
};
static PyMethodDef __pyx_methods[] = {
{0, 0, 0, 0}
};
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
PyModuleDef_HEAD_INIT,
__Pyx_NAMESTR("intbitset"),
0, /* m_doc */
-1, /* m_size */
__pyx_methods /* m_methods */,
NULL, /* m_reload */
NULL, /* m_traverse */
NULL, /* m_clear */
NULL /* m_free */
};
#endif
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
{&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0},
{&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
{&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
{&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
{&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
{&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
{&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
{&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
{&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
{&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
{&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
{&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0},
{&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
{&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
{&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0},
{&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
{&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
{&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0},
{&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0},
{&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0},
{&__pyx_kp_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 0},
{&__pyx_kp_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 0},
{&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0},
{&__pyx_kp_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 0},
{&__pyx_kp_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 0},
{&__pyx_kp_s_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 1, 0},
{&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
{&__pyx_n_s_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 0, 1, 1},
{&__pyx_kp_s_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 0},
{&__pyx_kp_s_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 1, 0},
{&__pyx_n_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 1},
{&__pyx_n_s_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 0, 1, 1},
{&__pyx_n_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 1},
{&__pyx_n_s_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 0, 1, 1},
{&__pyx_n_s_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 1, 1},
{&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
{&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
{&__pyx_kp_s__0, __pyx_k__0, sizeof(__pyx_k__0), 0, 0, 1, 0},
{&__pyx_kp_s__1, __pyx_k__1, sizeof(__pyx_k__1), 0, 0, 1, 0},
{&__pyx_n_s__AttributeError, __pyx_k__AttributeError, sizeof(__pyx_k__AttributeError), 0, 0, 1, 1},
{&__pyx_n_s__Error, __pyx_k__Error, sizeof(__pyx_k__Error), 0, 0, 1, 1},
{&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
{&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1},
{&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1},
{&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1},
{&__pyx_n_s__OverflowError, __pyx_k__OverflowError, sizeof(__pyx_k__OverflowError), 0, 0, 1, 1},
{&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
{&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
{&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
{&__pyx_n_s___, __pyx_k___, sizeof(__pyx_k___), 0, 0, 1, 1},
{&__pyx_n_s____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1},
{&__pyx_n_s____and__, __pyx_k____and__, sizeof(__pyx_k____and__), 0, 0, 1, 1},
{&__pyx_n_s____apilevel__, __pyx_k____apilevel__, sizeof(__pyx_k____apilevel__), 0, 0, 1, 1},
{&__pyx_n_s____ge__, __pyx_k____ge__, sizeof(__pyx_k____ge__), 0, 0, 1, 1},
{&__pyx_n_s____getitem__, __pyx_k____getitem__, sizeof(__pyx_k____getitem__), 0, 0, 1, 1},
{&__pyx_n_s____iand__, __pyx_k____iand__, sizeof(__pyx_k____iand__), 0, 0, 1, 1},
{&__pyx_n_s____ior__, __pyx_k____ior__, sizeof(__pyx_k____ior__), 0, 0, 1, 1},
{&__pyx_n_s____isub__, __pyx_k____isub__, sizeof(__pyx_k____isub__), 0, 0, 1, 1},
{&__pyx_n_s____iter__, __pyx_k____iter__, sizeof(__pyx_k____iter__), 0, 0, 1, 1},
{&__pyx_n_s____ixor__, __pyx_k____ixor__, sizeof(__pyx_k____ixor__), 0, 0, 1, 1},
{&__pyx_n_s____le__, __pyx_k____le__, sizeof(__pyx_k____le__), 0, 0, 1, 1},
{&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
{&__pyx_n_s____maxelem__, __pyx_k____maxelem__, sizeof(__pyx_k____maxelem__), 0, 0, 1, 1},
{&__pyx_n_s____or__, __pyx_k____or__, sizeof(__pyx_k____or__), 0, 0, 1, 1},
{&__pyx_n_s____repr__, __pyx_k____repr__, sizeof(__pyx_k____repr__), 0, 0, 1, 1},
{&__pyx_n_s____revision__, __pyx_k____revision__, sizeof(__pyx_k____revision__), 0, 0, 1, 1},
{&__pyx_n_s____sub__, __pyx_k____sub__, sizeof(__pyx_k____sub__), 0, 0, 1, 1},
{&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
{&__pyx_n_s____xor__, __pyx_k____xor__, sizeof(__pyx_k____xor__), 0, 0, 1, 1},
{&__pyx_n_s__add, __pyx_k__add, sizeof(__pyx_k__add), 0, 0, 1, 1},
{&__pyx_n_s__array, __pyx_k__array, sizeof(__pyx_k__array), 0, 0, 1, 1},
{&__pyx_n_s__bitset, __pyx_k__bitset, sizeof(__pyx_k__bitset), 0, 0, 1, 1},
{&__pyx_n_s__compress, __pyx_k__compress, sizeof(__pyx_k__compress), 0, 0, 1, 1},
{&__pyx_n_s__decompress, __pyx_k__decompress, sizeof(__pyx_k__decompress), 0, 0, 1, 1},
{&__pyx_n_s__difference, __pyx_k__difference, sizeof(__pyx_k__difference), 0, 0, 1, 1},
{&__pyx_n_s__difference_update, __pyx_k__difference_update, sizeof(__pyx_k__difference_update), 0, 0, 1, 1},
{&__pyx_n_s__extract_finite_list, __pyx_k__extract_finite_list, sizeof(__pyx_k__extract_finite_list), 0, 0, 1, 1},
{&__pyx_n_s__fastdump, __pyx_k__fastdump, sizeof(__pyx_k__fastdump), 0, 0, 1, 1},
{&__pyx_n_s__indices, __pyx_k__indices, sizeof(__pyx_k__indices), 0, 0, 1, 1},
{&__pyx_n_s__intbitset, __pyx_k__intbitset, sizeof(__pyx_k__intbitset), 0, 0, 1, 1},
{&__pyx_n_s__intersection, __pyx_k__intersection, sizeof(__pyx_k__intersection), 0, 0, 1, 1},
{&__pyx_n_s__intersection_update, __pyx_k__intersection_update, sizeof(__pyx_k__intersection_update), 0, 0, 1, 1},
{&__pyx_n_s__iteritems, __pyx_k__iteritems, sizeof(__pyx_k__iteritems), 0, 0, 1, 1},
{&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
{&__pyx_n_s__max, __pyx_k__max, sizeof(__pyx_k__max), 0, 0, 1, 1},
{&__pyx_n_s__no_allocate, __pyx_k__no_allocate, sizeof(__pyx_k__no_allocate), 0, 0, 1, 1},
{&__pyx_n_s__preallocate, __pyx_k__preallocate, sizeof(__pyx_k__preallocate), 0, 0, 1, 1},
{&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
{&__pyx_n_s__rhs, __pyx_k__rhs, sizeof(__pyx_k__rhs), 0, 0, 1, 1},
{&__pyx_n_s__sanity_checks, __pyx_k__sanity_checks, sizeof(__pyx_k__sanity_checks), 0, 0, 1, 1},
{&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1},
{&__pyx_n_s__stop, __pyx_k__stop, sizeof(__pyx_k__stop), 0, 0, 1, 1},
{&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
{&__pyx_n_s__tostring, __pyx_k__tostring, sizeof(__pyx_k__tostring), 0, 0, 1, 1},
{&__pyx_n_s__trailing_bits, __pyx_k__trailing_bits, sizeof(__pyx_k__trailing_bits), 0, 0, 1, 1},
{&__pyx_n_s__union, __pyx_k__union, sizeof(__pyx_k__union), 0, 0, 1, 1},
{&__pyx_n_s__union_update, __pyx_k__union_update, sizeof(__pyx_k__union_update), 0, 0, 1, 1},
{&__pyx_n_s__up_to, __pyx_k__up_to, sizeof(__pyx_k__up_to), 0, 0, 1, 1},
{&__pyx_n_s__zlib, __pyx_k__zlib, sizeof(__pyx_k__zlib), 0, 0, 1, 1},
{0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
__pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_max = __Pyx_GetName(__pyx_b, __pyx_n_s__max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_OverflowError = __Pyx_GetName(__pyx_b, __pyx_n_s__OverflowError); if (!__pyx_builtin_OverflowError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __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 = 471; __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 = 476; __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 = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_AttributeError = __Pyx_GetName(__pyx_b, __pyx_n_s__AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __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 = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_MemoryError = __Pyx_GetName(__pyx_b, __pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
return 0;
__pyx_L1_error:;
return -1;
}
static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
/* "lib/intbitset.pyx":178
* if type(rhs) in (int, long):
* if rhs < 0:
* raise ValueError("rhs can't be negative") # <<<<<<<<<<<<<<
* self.bitset = intBitSetCreate(rhs, trailing_bits)
* elif type(rhs) is intbitset:
*/
__pyx_k_tuple_3 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_3);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
PyTuple_SET_ITEM(__pyx_k_tuple_3, 0, ((PyObject *)__pyx_kp_s_2));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));
/* "lib/intbitset.pyx":188
* tmp = zlib.decompress(rhs)
* if PyObject_AsReadBuffer(tmp, &buf, &size) < 0:
* raise Exception("Buffer error!!!") # <<<<<<<<<<<<<<
* if (size % wordbytesize):
* ## Wrong size!
*/
__pyx_k_tuple_5 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_5);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_4));
PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, ((PyObject *)__pyx_kp_s_4));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));
/* "lib/intbitset.pyx":214
* elem = tmp_tuple[0]
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_9);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));
/* "lib/intbitset.pyx":223
* for elem in rhs:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_11);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11));
/* "lib/intbitset.pyx":248
* elem = tmp_tuple[0]
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_k_tuple_12 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_12);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));
/* "lib/intbitset.pyx":255
* for elem in rhs:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_k_tuple_13 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_13);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_13, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));
/* "lib/intbitset.pyx":282
* if self.sanity_checks:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem)
*/
__pyx_k_tuple_16 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_16);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_16, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));
/* "lib/intbitset.pyx":288
*
* def __cmp__(self, intbitset rhs not None):
* raise TypeError("cannot compare intbitset using cmp()") # <<<<<<<<<<<<<<
*
* def __richcmp__(self, intbitset rhs not None, int op):
*/
__pyx_k_tuple_19 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_19);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
PyTuple_SET_ITEM(__pyx_k_tuple_19, 0, ((PyObject *)__pyx_kp_s_18));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));
/* "lib/intbitset.pyx":320
* if self.sanity_checks:
* if rhs < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif rhs > maxelem:
* raise OverflowError("rhs must be <= %s" % maxelem)
*/
__pyx_k_tuple_20 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_20);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_20, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20));
/* "lib/intbitset.pyx":330
* for elem in rhs:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_k_tuple_22 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_22);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_22, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));
/* "lib/intbitset.pyx":337
* for elem in rhs:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_k_tuple_23 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_23);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_23, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));
/* "lib/intbitset.pyx":349
* if self.sanity_checks:
* if rhs < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif rhs > maxelem:
* raise OverflowError("rhs must be <= %s" % maxelem)
*/
__pyx_k_tuple_24 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_24);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));
/* "lib/intbitset.pyx":359
* for elem in rhs:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_k_tuple_25 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_25);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_25, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));
/* "lib/intbitset.pyx":374
* if self.sanity_checks:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem)
*/
__pyx_k_tuple_26 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_26);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_26, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));
/* "lib/intbitset.pyx":471
* ## This is a slice object!
* if self.bitset.trailing_bits and (key.start < 0 or key.stop < 0):
* raise IndexError("negative indexes are not allowed on infinite intbitset") # <<<<<<<<<<<<<<
* retset = intbitset()
* start, end, step = key.indices(intBitSetGetTot(self.bitset))
*/
__pyx_k_tuple_35 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_35);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_34));
PyTuple_SET_ITEM(__pyx_k_tuple_35, 0, ((PyObject *)__pyx_kp_s_34));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));
/* "lib/intbitset.pyx":475
* start, end, step = key.indices(intBitSetGetTot(self.bitset))
* if step < 0:
* raise ValueError("negative steps are not yet supported") # <<<<<<<<<<<<<<
* for i in range(start):
* elem = intBitSetGetNext(self.bitset, elem)
*/
__pyx_k_tuple_37 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_37);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_36));
PyTuple_SET_ITEM(__pyx_k_tuple_37, 0, ((PyObject *)__pyx_kp_s_36));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_36));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));
/* "lib/intbitset.pyx":491
* if end < 0:
* if self.bitset.trailing_bits:
* raise IndexError("negative indexes are not allowed on infinite intbitset") # <<<<<<<<<<<<<<
* end += intBitSetGetTot(self.bitset)
* if end < 0:
*/
__pyx_k_tuple_38 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_38);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_34));
PyTuple_SET_ITEM(__pyx_k_tuple_38, 0, ((PyObject *)__pyx_kp_s_34));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38));
/* "lib/intbitset.pyx":494
* end += intBitSetGetTot(self.bitset)
* if end < 0:
* raise IndexError("intbitset index out of range") # <<<<<<<<<<<<<<
* if end >= intBitSetGetTot(self.bitset):
* raise IndexError("intbitset index out of range")
*/
__pyx_k_tuple_40 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_40);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_39));
PyTuple_SET_ITEM(__pyx_k_tuple_40, 0, ((PyObject *)__pyx_kp_s_39));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_39));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40));
/* "lib/intbitset.pyx":496
* raise IndexError("intbitset index out of range")
* if end >= intBitSetGetTot(self.bitset):
* raise IndexError("intbitset index out of range") # <<<<<<<<<<<<<<
* for i in range(end + 1):
* elem = intBitSetGetNext(self.bitset, elem)
*/
__pyx_k_tuple_41 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_41);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_39));
PyTuple_SET_ITEM(__pyx_k_tuple_41, 0, ((PyObject *)__pyx_kp_s_39));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_39));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));
/* "lib/intbitset.pyx":560
* def __iter__(self):
* if self.bitset.trailing_bits:
* raise OverflowError("It's impossible to iterate over an infinite set.") # <<<<<<<<<<<<<<
* return intbitset_iterator(self)
*
*/
__pyx_k_tuple_43 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_43);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_42));
PyTuple_SET_ITEM(__pyx_k_tuple_43, 0, ((PyObject *)__pyx_kp_s_42));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_42));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43));
/* "lib/intbitset.pyx":569
* if self.sanity_checks:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem)
*/
__pyx_k_tuple_44 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_44);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_44, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44));
/* "lib/intbitset.pyx":583
* if self.sanity_checks:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Element must be <= %s" % maxelem)
*/
__pyx_k_tuple_45 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_45);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_45, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45));
/* "lib/intbitset.pyx":634
* intBitSetResetFromBuffer((<intbitset> self).bitset, buf, size)
* except:
* raise ValueError("strdump is corrupted") # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_k_tuple_47 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_47);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_46));
PyTuple_SET_ITEM(__pyx_k_tuple_47, 0, ((PyObject *)__pyx_kp_s_46));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_46));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47));
/* "lib/intbitset.pyx":650
* ret = intBitSetGetLast(self.bitset)
* if ret < 0:
* raise KeyError("pop from an empty or infinite intbitset") # <<<<<<<<<<<<<<
* intBitSetDelElem(self.bitset, ret)
* return ret
*/
__pyx_k_tuple_49 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_49);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_48));
PyTuple_SET_ITEM(__pyx_k_tuple_49, 0, ((PyObject *)__pyx_kp_s_48));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_48));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49));
/* "lib/intbitset.pyx":660
* if self.sanity_checks:
* if elem < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif elem > maxelem:
* raise OverflowError("Elements must be <= %s" % maxelem)
*/
__pyx_k_tuple_50 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_50);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_50, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50));
/* "lib/intbitset.pyx":675
* cdef int last
* if (<intbitset> self).bitset.trailing_bits:
* raise OverflowError("It's impossible to print an infinite set.") # <<<<<<<<<<<<<<
* last = 0
* ret = []
*/
__pyx_k_tuple_52 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_52);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_51));
PyTuple_SET_ITEM(__pyx_k_tuple_52, 0, ((PyObject *)__pyx_kp_s_51));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_51));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_52));
/* "lib/intbitset.pyx":691
* for value, sign in rhs.iteritems():
* if value < 0:
* raise ValueError("Negative numbers, not allowed") # <<<<<<<<<<<<<<
* elif value > maxelem:
* raise OverflowError("Elements must <= %s" % maxelem)
*/
__pyx_k_tuple_54 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_54);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
PyTuple_SET_ITEM(__pyx_k_tuple_54, 0, ((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));
/* "lib/intbitset.pyx":705
* intBitSetAddElem(self.bitset, value)
* except AttributeError:
* raise TypeError("rhs should be a valid dictionary with integers keys and integer values") # <<<<<<<<<<<<<<
*
* def get_size(self):
*/
__pyx_k_tuple_57 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_57);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_56));
PyTuple_SET_ITEM(__pyx_k_tuple_57, 0, ((PyObject *)__pyx_kp_s_56));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_56));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57));
/* "lib/intbitset.pyx":749
* """
* if self.bitset.trailing_bits:
* raise OverflowError("It's impossible to retrieve a list of an infinite set") # <<<<<<<<<<<<<<
* return self.extract_finite_list()
*
*/
__pyx_k_tuple_60 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_60);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_59));
PyTuple_SET_ITEM(__pyx_k_tuple_60, 0, ((PyObject *)__pyx_kp_s_59));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_59));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_60));
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
__Pyx_RefNannyFinishContext();
return -1;
}
static int __Pyx_InitGlobals(void) {
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
__pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
__pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
return 0;
__pyx_L1_error:;
return -1;
}
#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initintbitset(void); /*proto*/
PyMODINIT_FUNC initintbitset(void)
#else
PyMODINIT_FUNC PyInit_intbitset(void); /*proto*/
PyMODINIT_FUNC PyInit_intbitset(void)
#endif
{
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
__Pyx_RefNannyDeclarations
#if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
PyErr_Clear();
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
if (!__Pyx_RefNanny)
Py_FatalError("failed to import 'refnanny' module");
}
#endif
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_intbitset(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_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 ---*/
#if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
#ifdef WITH_THREAD /* Python build with threading support? */
PyEval_InitThreads();
#endif
#endif
/*--- Module creation code ---*/
#if PY_MAJOR_VERSION < 3
__pyx_m = Py_InitModule4(__Pyx_NAMESTR("intbitset"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
#else
__pyx_m = PyModule_Create(&__pyx_moduledef);
#endif
if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
#if PY_MAJOR_VERSION < 3
Py_INCREF(__pyx_m);
#endif
__pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
/*--- Initialize various global constants etc. ---*/
if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_module_is_main_lib__intbitset) {
if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
}
/*--- Builtin init code ---*/
if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/*--- Constants init code ---*/
if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/*--- Global init code ---*/
/*--- Variable export code ---*/
/*--- Function export code ---*/
/*--- Type init code ---*/
if (PyType_Ready(&__pyx_type_3lib_9intbitset_intbitset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
{
PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_3lib_9intbitset_intbitset, "__isub__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_3lib_9intbitset_9intbitset_18__isub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_3lib_9intbitset_9intbitset_18__isub__.doc = __pyx_doc_3lib_9intbitset_9intbitset_18__isub__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_3lib_9intbitset_9intbitset_18__isub__;
}
}
{
PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_3lib_9intbitset_intbitset, "__and__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_3lib_9intbitset_9intbitset_24__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_3lib_9intbitset_9intbitset_24__and__.doc = __pyx_doc_3lib_9intbitset_9intbitset_24__and__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_3lib_9intbitset_9intbitset_24__and__;
}
}
{
PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_3lib_9intbitset_intbitset, "__or__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_3lib_9intbitset_9intbitset_26__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_3lib_9intbitset_9intbitset_26__or__.doc = __pyx_doc_3lib_9intbitset_9intbitset_26__or__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_3lib_9intbitset_9intbitset_26__or__;
}
}
{
PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_3lib_9intbitset_intbitset, "__xor__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_3lib_9intbitset_9intbitset_28__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_3lib_9intbitset_9intbitset_28__xor__.doc = __pyx_doc_3lib_9intbitset_9intbitset_28__xor__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_3lib_9intbitset_9intbitset_28__xor__;
}
}
{
PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_3lib_9intbitset_intbitset, "__sub__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_3lib_9intbitset_9intbitset_30__sub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_3lib_9intbitset_9intbitset_30__sub__.doc = __pyx_doc_3lib_9intbitset_9intbitset_30__sub__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_3lib_9intbitset_9intbitset_30__sub__;
}
}
{
PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_3lib_9intbitset_intbitset, "__iand__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_3lib_9intbitset_9intbitset_32__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_3lib_9intbitset_9intbitset_32__iand__.doc = __pyx_doc_3lib_9intbitset_9intbitset_32__iand__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_3lib_9intbitset_9intbitset_32__iand__;
}
}
{
PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_3lib_9intbitset_intbitset, "__ior__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_3lib_9intbitset_9intbitset_34__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_3lib_9intbitset_9intbitset_34__ior__.doc = __pyx_doc_3lib_9intbitset_9intbitset_34__ior__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_3lib_9intbitset_9intbitset_34__ior__;
}
}
{
PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_3lib_9intbitset_intbitset, "__ixor__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_3lib_9intbitset_9intbitset_36__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_3lib_9intbitset_9intbitset_36__ixor__.doc = __pyx_doc_3lib_9intbitset_9intbitset_36__ixor__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_3lib_9intbitset_9intbitset_36__ixor__;
}
}
if (__Pyx_SetAttrString(__pyx_m, "intbitset", (PyObject *)&__pyx_type_3lib_9intbitset_intbitset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_type_3lib_9intbitset_intbitset.tp_weaklistoffset == 0) __pyx_type_3lib_9intbitset_intbitset.tp_weaklistoffset = offsetof(struct __pyx_obj_3lib_9intbitset_intbitset, __weakref__);
__pyx_ptype_3lib_9intbitset_intbitset = &__pyx_type_3lib_9intbitset_intbitset;
if (PyType_Ready(&__pyx_type_3lib_9intbitset_intbitset_iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetAttrString(__pyx_m, "intbitset_iterator", (PyObject *)&__pyx_type_3lib_9intbitset_intbitset_iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_type_3lib_9intbitset_intbitset_iterator.tp_weaklistoffset == 0) __pyx_type_3lib_9intbitset_intbitset_iterator.tp_weaklistoffset = offsetof(struct __pyx_obj_3lib_9intbitset_intbitset_iterator, __weakref__);
__pyx_ptype_3lib_9intbitset_intbitset_iterator = &__pyx_type_3lib_9intbitset_intbitset_iterator;
/*--- Type import code ---*/
/*--- Variable import code ---*/
/*--- Function import code ---*/
/*--- Execution code ---*/
/* "lib/intbitset.pyx":18
* ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* __revision__ = "$Id$" # <<<<<<<<<<<<<<
* __apilevel__ = 1.06
*
*/
if (PyObject_SetAttr(__pyx_m, __pyx_n_s____revision__, ((PyObject *)__pyx_kp_s_63)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "lib/intbitset.pyx":19
*
* __revision__ = "$Id$"
* __apilevel__ = 1.06 # <<<<<<<<<<<<<<
*
* """
*/
__pyx_t_1 = PyFloat_FromDouble(1.06); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s____apilevel__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "lib/intbitset.pyx":42
* """
*
* import zlib # <<<<<<<<<<<<<<
* import sys
* from array import array
*/
__pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__zlib), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__zlib, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "lib/intbitset.pyx":43
*
* import zlib
* import sys # <<<<<<<<<<<<<<
* from array import array
* from invenio.config import CFG_INTBITSET_ENABLE_SANITY_CHECKS
*/
__pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "lib/intbitset.pyx":44
* import zlib
* import sys
* from array import array # <<<<<<<<<<<<<<
* from invenio.config import CFG_INTBITSET_ENABLE_SANITY_CHECKS
* from invenio.intbitset_helper import _
*/
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_n_s__array));
PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__array));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__array));
__pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__array), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__array);
if (__pyx_t_1 == NULL) {
if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__array);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__array, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "lib/intbitset.pyx":45
* import sys
* from array import array
* from invenio.config import CFG_INTBITSET_ENABLE_SANITY_CHECKS # <<<<<<<<<<<<<<
* from invenio.intbitset_helper import _
*
*/
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_n_s_61));
PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s_61));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s_61));
__pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_64), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s_61);
if (__pyx_t_2 == NULL) {
if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s_61);
if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_GOTREF(__pyx_t_2);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_61, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "lib/intbitset.pyx":46
* from array import array
* from invenio.config import CFG_INTBITSET_ENABLE_SANITY_CHECKS
* from invenio.intbitset_helper import _ # <<<<<<<<<<<<<<
*
* __all__ = ['intbitset']
*/
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_n_s___));
PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s___));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s___));
__pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_65), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s___);
if (__pyx_t_1 == NULL) {
if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s___);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s___, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "lib/intbitset.pyx":48
* from invenio.intbitset_helper import _
*
* __all__ = ['intbitset'] # <<<<<<<<<<<<<<
*
* cdef extern from *:
*/
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_n_s__intbitset));
PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__intbitset));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__intbitset));
if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
/* "lib/intbitset.pyx":99
* unsigned char intBitSetCmp(IntBitSet *x, IntBitSet *y)
*
* __maxelem__ = maxelem # <<<<<<<<<<<<<<
*
* cdef class intbitset:
*/
__pyx_t_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s____maxelem__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "lib/intbitset.pyx":142
* cdef bint sanity_checks
*
* def __cinit__(self, rhs=0, int preallocate=-1, int trailing_bits=0, bint sanity_checks=CFG_INTBITSET_ENABLE_SANITY_CHECKS, int no_allocate=0): # <<<<<<<<<<<<<<
* """
* Initialize intbitset.
*/
__pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_61); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_k_1 = __pyx_t_3;
/* "lib/intbitset.pyx":555
* return _, (self.fastdump(),)
*
* __safe_for_unpickling__ = True # <<<<<<<<<<<<<<
*
* # Iterator interface
*/
__pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset->tp_dict, __pyx_n_s_66, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_3lib_9intbitset_intbitset);
/* "lib/intbitset.pyx":588
* intBitSetDelElem(self.bitset, elem)
*
* difference = __sub__ # <<<<<<<<<<<<<<
* difference_update = __isub__
* intersection = __and__
*/
__pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset, __pyx_n_s____sub__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset->tp_dict, __pyx_n_s__difference, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_3lib_9intbitset_intbitset);
/* "lib/intbitset.pyx":589
*
* difference = __sub__
* difference_update = __isub__ # <<<<<<<<<<<<<<
* intersection = __and__
* intersection_update = __iand__
*/
__pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset, __pyx_n_s____isub__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset->tp_dict, __pyx_n_s__difference_update, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_3lib_9intbitset_intbitset);
/* "lib/intbitset.pyx":590
* difference = __sub__
* difference_update = __isub__
* intersection = __and__ # <<<<<<<<<<<<<<
* intersection_update = __iand__
* union = __or__
*/
__pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset, __pyx_n_s____and__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset->tp_dict, __pyx_n_s__intersection, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_3lib_9intbitset_intbitset);
/* "lib/intbitset.pyx":591
* difference_update = __isub__
* intersection = __and__
* intersection_update = __iand__ # <<<<<<<<<<<<<<
* union = __or__
* union_update = __ior__
*/
__pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset, __pyx_n_s____iand__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset->tp_dict, __pyx_n_s__intersection_update, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_3lib_9intbitset_intbitset);
/* "lib/intbitset.pyx":592
* intersection = __and__
* intersection_update = __iand__
* union = __or__ # <<<<<<<<<<<<<<
* union_update = __ior__
* symmetric_difference = __xor__
*/
__pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset, __pyx_n_s____or__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset->tp_dict, __pyx_n_s__union, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_3lib_9intbitset_intbitset);
/* "lib/intbitset.pyx":593
* intersection_update = __iand__
* union = __or__
* union_update = __ior__ # <<<<<<<<<<<<<<
* symmetric_difference = __xor__
* symmetric_difference_update = __ixor__
*/
__pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset, __pyx_n_s____ior__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset->tp_dict, __pyx_n_s__union_update, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_3lib_9intbitset_intbitset);
/* "lib/intbitset.pyx":594
* union = __or__
* union_update = __ior__
* symmetric_difference = __xor__ # <<<<<<<<<<<<<<
* symmetric_difference_update = __ixor__
*
*/
__pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset, __pyx_n_s____xor__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset->tp_dict, __pyx_n_s_67, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_3lib_9intbitset_intbitset);
/* "lib/intbitset.pyx":595
* union_update = __ior__
* symmetric_difference = __xor__
* symmetric_difference_update = __ixor__ # <<<<<<<<<<<<<<
*
* def issubset(self, rhs):
*/
__pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset, __pyx_n_s____ixor__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem((PyObject *)__pyx_ptype_3lib_9intbitset_intbitset->tp_dict, __pyx_n_s_68, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_3lib_9intbitset_intbitset);
/* "lib/intbitset.pyx":1
* ## This file is part of Invenio. # <<<<<<<<<<<<<<
* ## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN.
* ##
*/
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
if (__pyx_m) {
__Pyx_AddTraceback("init lib.intbitset", __pyx_clineno, __pyx_lineno, __pyx_filename);
Py_DECREF(__pyx_m); __pyx_m = 0;
} else if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_ImportError, "init lib.intbitset");
}
__pyx_L0:;
__Pyx_RefNannyFinishContext();
#if PY_MAJOR_VERSION < 3
return;
#else
return __pyx_m;
#endif
}
/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
void *r = NULL;
m = PyImport_ImportModule((char *)modname);
if (!m) goto end;
p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
if (!p) goto end;
r = PyLong_AsVoidPtr(p);
end:
Py_XDECREF(p);
Py_XDECREF(m);
return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
PyObject *result;
result = PyObject_GetAttr(dict, name);
if (!result) {
if (dict != __pyx_b) {
PyErr_Clear();
result = PyObject_GetAttr(__pyx_b, name);
}
if (!result) {
PyErr_SetObject(PyExc_NameError, name);
}
}
return result;
}
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name,
PyObject* kw_name)
{
PyErr_Format(PyExc_TypeError,
#if PY_MAJOR_VERSION >= 3
"%s() got multiple values for keyword argument '%U'", func_name, kw_name);
#else
"%s() got multiple values for keyword argument '%s'", func_name,
PyString_AS_STRING(kw_name));
#endif
}
static int __Pyx_ParseOptionalKeywords(
PyObject *kwds,
PyObject **argnames[],
PyObject *kwds2,
PyObject *values[],
Py_ssize_t num_pos_args,
const char* function_name)
{
PyObject *key = 0, *value = 0;
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++;
if (*name) {
values[name-argnames] = value;
} else {
#if PY_MAJOR_VERSION < 3
if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
#else
if (unlikely(!PyUnicode_Check(key))) {
#endif
goto invalid_keyword_type;
} else {
for (name = first_kw_arg; *name; name++) {
#if PY_MAJOR_VERSION >= 3
if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
PyUnicode_Compare(**name, key) == 0) break;
#else
if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
_PyString_Eq(**name, key)) break;
#endif
}
if (*name) {
values[name-argnames] = value;
} else {
for (name=argnames; name != first_kw_arg; name++) {
if (**name == key) goto arg_passed_twice;
#if PY_MAJOR_VERSION >= 3
if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
#else
if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
_PyString_Eq(**name, key)) goto arg_passed_twice;
#endif
}
if (kwds2) {
if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
} else {
goto invalid_keyword;
}
}
}
}
}
return 0;
arg_passed_twice:
__Pyx_RaiseDoubleKeywordsError(function_name, **name);
goto bad;
invalid_keyword_type:
PyErr_Format(PyExc_TypeError,
"%s() keywords must be strings", function_name);
goto bad;
invalid_keyword:
PyErr_Format(PyExc_TypeError,
#if PY_MAJOR_VERSION < 3
"%s() got an unexpected keyword argument '%s'",
function_name, PyString_AsString(key));
#else
"%s() got an unexpected keyword argument '%U'",
function_name, key);
#endif
bad:
return -1;
}
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)
{
Py_ssize_t num_expected;
const char *more_or_less;
if (num_found < num_min) {
num_expected = num_min;
more_or_less = "at least";
} else {
num_expected = num_max;
more_or_less = "at most";
}
if (exact) {
more_or_less = "exactly";
}
PyErr_Format(PyExc_TypeError,
"%s() takes %s %"PY_FORMAT_SIZE_T"d positional argument%s (%"PY_FORMAT_SIZE_T"d given)",
func_name, more_or_less, num_expected,
(num_expected == 1) ? "" : "s", num_found);
}
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;
tstate->curexc_type = type;
tstate->curexc_value = value;
tstate->curexc_traceback = tb;
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,
CYTHON_UNUSED PyObject *cause) {
Py_XINCREF(type);
Py_XINCREF(value);
Py_XINCREF(tb);
if (tb == Py_None) {
Py_DECREF(tb);
tb = 0;
}
else if (tb != NULL && !PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError,
"raise: arg 3 must be a traceback or None");
goto raise_error;
}
if (value == NULL) {
value = Py_None;
Py_INCREF(value);
}
#if PY_VERSION_HEX < 0x02050000
if (!PyClass_Check(type))
#else
if (!PyType_Check(type))
#endif
{
if (value != Py_None) {
PyErr_SetString(PyExc_TypeError,
"instance exception may not have a separate value");
goto raise_error;
}
Py_DECREF(value);
value = type;
#if PY_VERSION_HEX < 0x02050000
if (PyInstance_Check(type)) {
type = (PyObject*) ((PyInstanceObject*)type)->in_class;
Py_INCREF(type);
}
else {
type = 0;
PyErr_SetString(PyExc_TypeError,
"raise: exception must be an old-style class or instance");
goto raise_error;
}
#else
type = (PyObject*) Py_TYPE(type);
Py_INCREF(type);
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
PyErr_SetString(PyExc_TypeError,
"raise: exception class must be a subclass of BaseException");
goto raise_error;
}
#endif
}
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
Py_XDECREF(value);
Py_XDECREF(type);
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;
} else if (tb && !PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError,
"raise: arg 3 must be a traceback or None");
goto bad;
}
if (value == Py_None)
value = 0;
if (PyExceptionInstance_Check(type)) {
if (value) {
PyErr_SetString(PyExc_TypeError,
"instance exception may not have a separate value");
goto bad;
}
value = type;
type = (PyObject*) Py_TYPE(value);
} else if (!PyExceptionClass_Check(type)) {
PyErr_SetString(PyExc_TypeError,
"raise: exception class must be a subclass of BaseException");
goto bad;
}
if (cause) {
PyObject *fixed_cause;
if (PyExceptionClass_Check(cause)) {
fixed_cause = PyObject_CallObject(cause, NULL);
if (fixed_cause == NULL)
goto bad;
}
else if (PyExceptionInstance_Check(cause)) {
fixed_cause = cause;
Py_INCREF(fixed_cause);
}
else {
PyErr_SetString(PyExc_TypeError,
"exception causes must derive from "
"BaseException");
goto bad;
}
if (!value) {
value = PyObject_CallObject(type, NULL);
}
PyException_SetCause(value, fixed_cause);
}
PyErr_SetObject(type, value);
if (tb) {
PyThreadState *tstate = PyThreadState_GET();
PyObject* tmp_tb = tstate->curexc_traceback;
if (tb != tmp_tb) {
Py_INCREF(tb);
tstate->curexc_traceback = tb;
Py_XDECREF(tmp_tb);
}
}
bad:
return;
}
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
Py_ssize_t r = a % b;
r += ((r != 0) & ((r ^ b) < 0)) * b;
return r;
}
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
PyObject *local_type, *local_value, *local_tb;
PyObject *tmp_type, *tmp_value, *tmp_tb;
PyThreadState *tstate = PyThreadState_GET();
local_type = tstate->curexc_type;
local_value = tstate->curexc_value;
local_tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
PyErr_NormalizeException(&local_type, &local_value, &local_tb);
if (unlikely(tstate->curexc_type))
goto bad;
#if PY_MAJOR_VERSION >= 3
if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
goto bad;
#endif
*type = local_type;
*value = local_value;
*tb = local_tb;
Py_INCREF(local_type);
Py_INCREF(local_value);
Py_INCREF(local_tb);
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
tstate->exc_type = local_type;
tstate->exc_value = local_value;
tstate->exc_traceback = local_tb;
/* Make sure tstate is in a consistent state when we XDECREF
these objects (XDECREF may run arbitrary code). */
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
return 0;
bad:
*type = 0;
*value = 0;
*tb = 0;
Py_XDECREF(local_type);
Py_XDECREF(local_value);
Py_XDECREF(local_tb);
return -1;
}
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact)
{
if (!type) {
PyErr_Format(PyExc_SystemError, "Missing type object");
return 0;
}
if (none_allowed && obj == Py_None) return 1;
else if (exact) {
if (Py_TYPE(obj) == type) return 1;
}
else {
if (PyObject_TypeCheck(obj, type)) return 1;
}
PyErr_Format(PyExc_TypeError,
"Argument '%s' has incorrect type (expected %s, got %s)",
name, type->tp_name, Py_TYPE(obj)->tp_name);
return 0;
}
static CYTHON_INLINE int __Pyx_div_int(int a, int b) {
int q = a / b;
int r = a - q*b;
q -= ((r != 0) & ((r ^ b) < 0));
return q;
}
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",
index, (index == 1) ? "" : "s");
}
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %"PY_FORMAT_SIZE_T"d)", expected);
}
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
if (unlikely(retval)) {
Py_DECREF(retval);
__Pyx_RaiseTooManyValuesError(expected);
return -1;
} else if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
PyErr_Clear();
return 0;
} else {
return -1;
}
}
return 0;
}
static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
PyThreadState *tstate = PyThreadState_GET();
*type = tstate->exc_type;
*value = tstate->exc_value;
*tb = tstate->exc_traceback;
Py_XINCREF(*type);
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();
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
tstate->exc_type = type;
tstate->exc_value = value;
tstate->exc_traceback = tb;
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
}
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
PyObject *py_import = 0;
PyObject *empty_list = 0;
PyObject *module = 0;
PyObject *global_dict = 0;
PyObject *empty_dict = 0;
PyObject *list;
py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
if (!py_import)
goto bad;
if (from_list)
list = from_list;
else {
empty_list = PyList_New(0);
if (!empty_list)
goto bad;
list = empty_list;
}
global_dict = PyModule_GetDict(__pyx_m);
if (!global_dict)
goto bad;
empty_dict = PyDict_New();
if (!empty_dict)
goto bad;
#if PY_VERSION_HEX >= 0x02050000
{
#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) {
PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
goto bad;
}
module = PyObject_CallFunctionObjArgs(py_import,
name, global_dict, empty_dict, list, NULL);
#endif
bad:
Py_XDECREF(empty_list);
Py_XDECREF(py_import);
Py_XDECREF(empty_dict);
return module;
}
static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
#if PY_MAJOR_VERSION < 3
PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
PyString_AsString(name));
#else
PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_word_t(word_t val) {
const word_t neg_one = (word_t)-1, const_zero = (word_t)0;
const int is_unsigned = const_zero < neg_one;
if ((sizeof(word_t) == sizeof(char)) ||
(sizeof(word_t) == sizeof(short))) {
return PyInt_FromLong((long)val);
} else if ((sizeof(word_t) == sizeof(int)) ||
(sizeof(word_t) == sizeof(long))) {
if (is_unsigned)
return PyLong_FromUnsignedLong((unsigned long)val);
else
return PyInt_FromLong((long)val);
} else if (sizeof(word_t) == sizeof(PY_LONG_LONG)) {
if (is_unsigned)
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
else
return PyLong_FromLongLong((PY_LONG_LONG)val);
} else {
int one = 1; int little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&val;
return _PyLong_FromByteArray(bytes, sizeof(word_t),
little, !is_unsigned);
}
}
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(unsigned char) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(unsigned char)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to unsigned char" :
"value too large to convert to unsigned char");
}
return (unsigned char)-1;
}
return (unsigned char)val;
}
return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(unsigned short) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(unsigned short)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to unsigned short" :
"value too large to convert to unsigned short");
}
return (unsigned short)-1;
}
return (unsigned short)val;
}
return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(unsigned int) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(unsigned int)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to unsigned int" :
"value too large to convert to unsigned int");
}
return (unsigned int)-1;
}
return (unsigned int)val;
}
return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
const char neg_one = (char)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(char) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(char)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to char" :
"value too large to convert to char");
}
return (char)-1;
}
return (char)val;
}
return (char)__Pyx_PyInt_AsLong(x);
}
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
const short neg_one = (short)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(short) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(short)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to short" :
"value too large to convert to short");
}
return (short)-1;
}
return (short)val;
}
return (short)__Pyx_PyInt_AsLong(x);
}
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
const int neg_one = (int)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(int) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(int)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to int" :
"value too large to convert to int");
}
return (int)-1;
}
return (int)val;
}
return (int)__Pyx_PyInt_AsLong(x);
}
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
const signed char neg_one = (signed char)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(signed char) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(signed char)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to signed char" :
"value too large to convert to signed char");
}
return (signed char)-1;
}
return (signed char)val;
}
return (signed char)__Pyx_PyInt_AsSignedLong(x);
}
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
const signed short neg_one = (signed short)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(signed short) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(signed short)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to signed short" :
"value too large to convert to signed short");
}
return (signed short)-1;
}
return (signed short)val;
}
return (signed short)__Pyx_PyInt_AsSignedLong(x);
}
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
const signed int neg_one = (signed int)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(signed int) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(signed int)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to signed int" :
"value too large to convert to signed int");
}
return (signed int)-1;
}
return (signed int)val;
}
return (signed int)__Pyx_PyInt_AsSignedLong(x);
}
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
const int neg_one = (int)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(int) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(int)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to int" :
"value too large to convert to int");
}
return (int)-1;
}
return (int)val;
}
return (int)__Pyx_PyInt_AsLong(x);
}
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
if (likely(PyInt_Check(x))) {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to unsigned long");
return (unsigned long)-1;
}
return (unsigned long)val;
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
if (unlikely(Py_SIZE(x) < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to unsigned long");
return (unsigned long)-1;
}
return (unsigned long)PyLong_AsUnsignedLong(x);
} else {
return (unsigned long)PyLong_AsLong(x);
}
} else {
unsigned long val;
PyObject *tmp = __Pyx_PyNumber_Int(x);
if (!tmp) return (unsigned long)-1;
val = __Pyx_PyInt_AsUnsignedLong(tmp);
Py_DECREF(tmp);
return val;
}
}
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
if (likely(PyInt_Check(x))) {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to unsigned PY_LONG_LONG");
return (unsigned PY_LONG_LONG)-1;
}
return (unsigned PY_LONG_LONG)val;
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
if (unlikely(Py_SIZE(x) < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to unsigned PY_LONG_LONG");
return (unsigned PY_LONG_LONG)-1;
}
return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
} else {
return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
}
} else {
unsigned PY_LONG_LONG val;
PyObject *tmp = __Pyx_PyNumber_Int(x);
if (!tmp) return (unsigned PY_LONG_LONG)-1;
val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
Py_DECREF(tmp);
return val;
}
}
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
const long neg_one = (long)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
if (likely(PyInt_Check(x))) {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to long");
return (long)-1;
}
return (long)val;
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
if (unlikely(Py_SIZE(x) < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to long");
return (long)-1;
}
return (long)PyLong_AsUnsignedLong(x);
} else {
return (long)PyLong_AsLong(x);
}
} else {
long val;
PyObject *tmp = __Pyx_PyNumber_Int(x);
if (!tmp) return (long)-1;
val = __Pyx_PyInt_AsLong(tmp);
Py_DECREF(tmp);
return val;
}
}
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
if (likely(PyInt_Check(x))) {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to PY_LONG_LONG");
return (PY_LONG_LONG)-1;
}
return (PY_LONG_LONG)val;
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
if (unlikely(Py_SIZE(x) < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to PY_LONG_LONG");
return (PY_LONG_LONG)-1;
}
return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
} else {
return (PY_LONG_LONG)PyLong_AsLongLong(x);
}
} else {
PY_LONG_LONG val;
PyObject *tmp = __Pyx_PyNumber_Int(x);
if (!tmp) return (PY_LONG_LONG)-1;
val = __Pyx_PyInt_AsLongLong(tmp);
Py_DECREF(tmp);
return val;
}
}
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
const signed long neg_one = (signed long)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
if (likely(PyInt_Check(x))) {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to signed long");
return (signed long)-1;
}
return (signed long)val;
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
if (unlikely(Py_SIZE(x) < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to signed long");
return (signed long)-1;
}
return (signed long)PyLong_AsUnsignedLong(x);
} else {
return (signed long)PyLong_AsLong(x);
}
} else {
signed long val;
PyObject *tmp = __Pyx_PyNumber_Int(x);
if (!tmp) return (signed long)-1;
val = __Pyx_PyInt_AsSignedLong(tmp);
Py_DECREF(tmp);
return val;
}
}
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
if (likely(PyInt_Check(x))) {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to signed PY_LONG_LONG");
return (signed PY_LONG_LONG)-1;
}
return (signed PY_LONG_LONG)val;
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
if (unlikely(Py_SIZE(x) < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to signed PY_LONG_LONG");
return (signed PY_LONG_LONG)-1;
}
return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
} else {
return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
}
} else {
signed PY_LONG_LONG val;
PyObject *tmp = __Pyx_PyNumber_Int(x);
if (!tmp) return (signed PY_LONG_LONG)-1;
val = __Pyx_PyInt_AsSignedLongLong(tmp);
Py_DECREF(tmp);
return val;
}
}
static int __Pyx_check_binary_version(void) {
char ctversion[4], rtversion[4];
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
char message[200];
PyOS_snprintf(message, sizeof(message),
"compiletime version %s of module '%.100s' "
"does not match runtime version %s",
ctversion, __Pyx_MODULE_NAME, rtversion);
#if PY_VERSION_HEX < 0x02050000
return PyErr_Warn(NULL, message);
#else
return PyErr_WarnEx(NULL, message, 1);
#endif
}
return 0;
}
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 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;
#if PY_MAJOR_VERSION < 3
py_srcfile = PyString_FromString(filename);
#else
py_srcfile = PyUnicode_FromString(filename);
#endif
if (!py_srcfile) goto bad;
if (c_line) {
#if PY_MAJOR_VERSION < 3
py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
#else
py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
#endif
}
else {
#if PY_MAJOR_VERSION < 3
py_funcname = PyString_FromString(funcname);
#else
py_funcname = PyUnicode_FromString(funcname);
#endif
}
if (!py_funcname) goto bad;
py_code = __Pyx_PyCode_New(
0, /*int argcount,*/
0, /*int kwonlyargcount,*/
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,*/
py_srcfile, /*PyObject *filename,*/
py_funcname, /*PyObject *name,*/
py_line, /*int firstlineno,*/
__pyx_empty_bytes /*PyObject *lnotab*/
);
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,*/
py_globals, /*PyObject *globals,*/
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
py_frame->f_lineno = py_line;
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_code);
Py_XDECREF(py_frame);
}
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
} else if (t->intern) {
*t->p = PyString_InternFromString(t->s);
} else {
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
}
#else /* Python 3+ has unicode identifiers */
if (t->is_unicode | t->is_str) {
if (t->intern) {
*t->p = PyUnicode_InternFromString(t->s);
} else if (t->encoding) {
*t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
} else {
*t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
}
} else {
*t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
}
#endif
if (!*t->p)
return -1;
++t;
}
return 0;
}
/* Type Conversion Functions */
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
int is_true = x == Py_True;
if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
PyNumberMethods *m;
const char *name = NULL;
PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
if (PyInt_Check(x) || PyLong_Check(x))
#else
if (PyLong_Check(x))
#endif
return Py_INCREF(x), x;
m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
if (m && m->nb_int) {
name = "int";
res = PyNumber_Int(x);
}
else if (m && m->nb_long) {
name = "long";
res = PyNumber_Long(x);
}
#else
if (m && m->nb_int) {
name = "int";
res = PyNumber_Long(x);
}
#endif
if (res) {
#if PY_VERSION_HEX < 0x03000000
if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
if (!PyLong_Check(res)) {
#endif
PyErr_Format(PyExc_TypeError,
"__%s__ returned non-%s (type %.200s)",
name, name, Py_TYPE(res)->tp_name);
Py_DECREF(res);
return NULL;
}
}
else if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError,
"an integer is required");
}
return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
Py_ssize_t ival;
PyObject* x = PyNumber_Index(b);
if (!x) return -1;
ival = PyInt_AsSsize_t(x);
Py_DECREF(x);
return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
if (ival <= LONG_MAX)
return PyInt_FromLong((long)ival);
else {
unsigned char *bytes = (unsigned char *) &ival;
int one = 1; int little = (int)*(unsigned char*)&one;
return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
}
#else
return PyInt_FromSize_t(ival);
#endif
}
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
return (size_t)-1;
} else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
PyErr_SetString(PyExc_OverflowError,
"value too large to convert to size_t");
return (size_t)-1;
}
return (size_t)val;
}
#endif /* Py_PYTHON_H */

Event Timeline