Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added the SEOmoz MIT license.

  • Loading branch information...
commit 2eecd116559b6067c9ce8bd8bfb0334e4611334d 1 parent 225ea56
Dan Lecocq authored
View
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2011 SEOmoz
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
2  README.md
@@ -50,7 +50,7 @@ The Story
We needed to keep track of sets of urls that we had seen when crawling web
pages, and had previously been keeping track of them in redis sets. Redis
sets are, after all, extremely fast. As you can see in the benchmarks, set
-insertions can handle about 500k 20-character insertions per second. _That_
+insertions can handle about 50k 20-character insertions per second. _That_
is performant.
However, these sets of urls got to be prohibitively large. But, since we
View
22 pyreBloom/bloom.c
@@ -1,3 +1,25 @@
+/* Copyright (c) 2011 SEOmoz
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
#include "bloom.h"
#include <math.h>
#include <stdio.h>
View
22 pyreBloom/bloom.h
@@ -1,3 +1,25 @@
+/* Copyright (c) 2011 SEOmoz
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
#ifndef PYRE_BLOOM_H
#define PYRE_BLOOM_H
View
21 pyreBloom/bloom.pxd
@@ -1,3 +1,24 @@
+# Copyright (c) 2011 SEOmoz
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
cdef extern from "bloom.h":
ctypedef struct redisContext
ctypedef unsigned int uint32_t
View
187 pyreBloom/pyreBloom.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.15.1 on Wed Jan 4 15:10:27 2012 */
+/* Generated by Cython 0.15.1 on Thu Jan 5 11:41:24 2012 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -321,7 +321,7 @@ static const char *__pyx_f[] = {
/*--- Type declarations ---*/
struct __pyx_obj_9pyreBloom_pyreBloom;
-/* "pyreBloom.pyx":6
+/* "pyreBloom.pyx":27
* cimport bloom
*
* cdef class pyreBloom(object): # <<<<<<<<<<<<<<
@@ -459,7 +459,7 @@ static PyObject *__pyx_n_s__math;
static PyObject *__pyx_n_s__put;
static PyObject *__pyx_n_s__random;
-/* "pyreBloom.pyx":11
+/* "pyreBloom.pyx":32
*
* property bits:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -477,7 +477,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_4bits___get__(PyObject *__pyx_v_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__");
- /* "pyreBloom.pyx":12
+ /* "pyreBloom.pyx":33
* property bits:
* def __get__(self):
* return self.context.bits # <<<<<<<<<<<<<<
@@ -485,7 +485,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_4bits___get__(PyObject *__pyx_v_
* property hashes:
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_to_py_uint32_t(((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->context.bits); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_to_py_uint32_t(((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->context.bits); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -503,7 +503,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_4bits___get__(PyObject *__pyx_v_
return __pyx_r;
}
-/* "pyreBloom.pyx":15
+/* "pyreBloom.pyx":36
*
* property hashes:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -521,7 +521,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_6hashes___get__(PyObject *__pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__");
- /* "pyreBloom.pyx":16
+ /* "pyreBloom.pyx":37
* property hashes:
* def __get__(self):
* return self.context.hashes # <<<<<<<<<<<<<<
@@ -529,7 +529,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_6hashes___get__(PyObject *__pyx_
* def __cinit__(self, key, capacity, error):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_to_py_uint32_t(((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->context.hashes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_to_py_uint32_t(((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->context.hashes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -547,7 +547,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_6hashes___get__(PyObject *__pyx_
return __pyx_r;
}
-/* "pyreBloom.pyx":18
+/* "pyreBloom.pyx":39
* return self.context.hashes
*
* def __cinit__(self, key, capacity, error): # <<<<<<<<<<<<<<
@@ -591,17 +591,17 @@ static int __pyx_pf_9pyreBloom_9pyreBloom___cinit__(PyObject *__pyx_v_self, PyOb
values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__capacity);
if (likely(values[1])) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__error);
if (likely(values[2])) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -616,37 +616,37 @@ static int __pyx_pf_9pyreBloom_9pyreBloom___cinit__(PyObject *__pyx_v_self, PyOb
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("pyreBloom.pyreBloom.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- /* "pyreBloom.pyx":19
+ /* "pyreBloom.pyx":40
*
* def __cinit__(self, key, capacity, error):
* self.key = key # <<<<<<<<<<<<<<
* bloom.init_pyrebloom(&self.context, self.key, capacity, error)
*
*/
- if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_key)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_key)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_INCREF(__pyx_v_key);
__Pyx_GIVEREF(__pyx_v_key);
__Pyx_GOTREF(((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->key);
__Pyx_DECREF(((PyObject *)((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->key));
((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->key = ((PyObject*)__pyx_v_key);
- /* "pyreBloom.pyx":20
+ /* "pyreBloom.pyx":41
* def __cinit__(self, key, capacity, error):
* self.key = key
* bloom.init_pyrebloom(&self.context, self.key, capacity, error) # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
- __pyx_t_1 = __Pyx_PyBytes_AsUString(((PyObject *)((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->key)); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyInt_from_py_uint32_t(__pyx_v_capacity); if (unlikely((__pyx_t_2 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_error); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_AsUString(((PyObject *)((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->key)); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_from_py_uint32_t(__pyx_v_capacity); if (unlikely((__pyx_t_2 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_error); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
init_pyrebloom((&((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->context), __pyx_t_1, __pyx_t_2, __pyx_t_3);
__pyx_r = 0;
@@ -659,7 +659,7 @@ static int __pyx_pf_9pyreBloom_9pyreBloom___cinit__(PyObject *__pyx_v_self, PyOb
return __pyx_r;
}
-/* "pyreBloom.pyx":22
+/* "pyreBloom.pyx":43
* bloom.init_pyrebloom(&self.context, self.key, capacity, error)
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -672,7 +672,7 @@ static void __pyx_pf_9pyreBloom_9pyreBloom_1__dealloc__(PyObject *__pyx_v_self)
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__");
- /* "pyreBloom.pyx":23
+ /* "pyreBloom.pyx":44
*
* def __dealloc__(self):
* bloom.free_pyrebloom(&self.context) # <<<<<<<<<<<<<<
@@ -684,7 +684,7 @@ static void __pyx_pf_9pyreBloom_9pyreBloom_1__dealloc__(PyObject *__pyx_v_self)
__Pyx_RefNannyFinishContext();
}
-/* "pyreBloom.pyx":25
+/* "pyreBloom.pyx":46
* bloom.free_pyrebloom(&self.context)
*
* def delete(self): # <<<<<<<<<<<<<<
@@ -698,7 +698,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_2delete(PyObject *__pyx_v_self,
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("delete");
- /* "pyreBloom.pyx":26
+ /* "pyreBloom.pyx":47
*
* def delete(self):
* bloom.delete(&self.context) # <<<<<<<<<<<<<<
@@ -713,7 +713,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_2delete(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "pyreBloom.pyx":28
+/* "pyreBloom.pyx":49
* bloom.delete(&self.context)
*
* def put(self, value): # <<<<<<<<<<<<<<
@@ -740,7 +740,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_3put(PyObject *__pyx_v_self, PyO
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("put");
- /* "pyreBloom.pyx":29
+ /* "pyreBloom.pyx":50
*
* def put(self, value):
* if getattr(value, '__iter__', False): # <<<<<<<<<<<<<<
@@ -749,30 +749,30 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_3put(PyObject *__pyx_v_self, PyO
*/
__pyx_t_1 = ((PyObject *)__pyx_n_s____iter__);
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_value, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_value, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_4) {
- /* "pyreBloom.pyx":30
+ /* "pyreBloom.pyx":51
* def put(self, value):
* if getattr(value, '__iter__', False):
* r = [bloom.add(&self.context, v, len(v)) for v in value] # <<<<<<<<<<<<<<
* bloom.add_complete(&self.context, len(value))
* else:
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
if (PyList_CheckExact(__pyx_v_value) || PyTuple_CheckExact(__pyx_v_value)) {
__pyx_t_2 = __pyx_v_value; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
__pyx_t_6 = NULL;
} else {
- __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -788,7 +788,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_3put(PyObject *__pyx_v_self, PyO
if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -797,11 +797,11 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_3put(PyObject *__pyx_v_self, PyO
__Pyx_XDECREF(__pyx_v_v);
__pyx_v_v = __pyx_t_1;
__pyx_t_1 = 0;
- __pyx_t_7 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = __Pyx_PyBool_FromLong(add((&((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->context), __pyx_t_7, __pyx_t_8)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(add((&((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->context), __pyx_t_7, __pyx_t_8)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (unlikely(PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __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;
@@ -809,31 +809,31 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_3put(PyObject *__pyx_v_self, PyO
__pyx_v_r = __pyx_t_3;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- /* "pyreBloom.pyx":31
+ /* "pyreBloom.pyx":52
* if getattr(value, '__iter__', False):
* r = [bloom.add(&self.context, v, len(v)) for v in value]
* bloom.add_complete(&self.context, len(value)) # <<<<<<<<<<<<<<
* else:
* bloom.add(&self.context, value, len(value))
*/
- __pyx_t_5 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
add_complete((&((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->context), __pyx_t_5);
goto __pyx_L5;
}
/*else*/ {
- /* "pyreBloom.pyx":33
+ /* "pyreBloom.pyx":54
* bloom.add_complete(&self.context, len(value))
* else:
* bloom.add(&self.context, value, len(value)) # <<<<<<<<<<<<<<
* bloom.add_complete(&self.context, 1)
*
*/
- __pyx_t_7 = PyBytes_AsString(__pyx_v_value); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyBytes_AsString(__pyx_v_value); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
add((&((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->context), __pyx_t_7, __pyx_t_5);
- /* "pyreBloom.pyx":34
+ /* "pyreBloom.pyx":55
* else:
* bloom.add(&self.context, value, len(value))
* bloom.add_complete(&self.context, 1) # <<<<<<<<<<<<<<
@@ -860,7 +860,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_3put(PyObject *__pyx_v_self, PyO
return __pyx_r;
}
-/* "pyreBloom.pyx":36
+/* "pyreBloom.pyx":57
* bloom.add_complete(&self.context, 1)
*
* def add(self, value): # <<<<<<<<<<<<<<
@@ -880,21 +880,21 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_4add(PyObject *__pyx_v_self, PyO
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add");
- /* "pyreBloom.pyx":37
+ /* "pyreBloom.pyx":58
*
* def add(self, value):
* self.put(value) # <<<<<<<<<<<<<<
*
* def extend(self, values):
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __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 = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__Pyx_INCREF(__pyx_v_value);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value);
__Pyx_GIVEREF(__pyx_v_value);
- __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 = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 58; __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;
@@ -914,7 +914,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_4add(PyObject *__pyx_v_self, PyO
return __pyx_r;
}
-/* "pyreBloom.pyx":39
+/* "pyreBloom.pyx":60
* self.put(value)
*
* def extend(self, values): # <<<<<<<<<<<<<<
@@ -934,21 +934,21 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_5extend(PyObject *__pyx_v_self,
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extend");
- /* "pyreBloom.pyx":40
+ /* "pyreBloom.pyx":61
*
* def extend(self, values):
* self.put(values) # <<<<<<<<<<<<<<
*
* def contains(self, value):
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __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 = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__Pyx_INCREF(__pyx_v_values);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_values);
__Pyx_GIVEREF(__pyx_v_values);
- __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 = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 61; __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;
@@ -968,7 +968,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_5extend(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "pyreBloom.pyx":42
+/* "pyreBloom.pyx":63
* self.put(values)
*
* def contains(self, value): # <<<<<<<<<<<<<<
@@ -995,7 +995,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_6contains(PyObject *__pyx_v_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("contains");
- /* "pyreBloom.pyx":44
+ /* "pyreBloom.pyx":65
* def contains(self, value):
* # If the object is 'iterable'...
* if getattr(value, '__iter__', False): # <<<<<<<<<<<<<<
@@ -1004,30 +1004,30 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_6contains(PyObject *__pyx_v_self
*/
__pyx_t_1 = ((PyObject *)__pyx_n_s____iter__);
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_value, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_value, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_4) {
- /* "pyreBloom.pyx":45
+ /* "pyreBloom.pyx":66
* # If the object is 'iterable'...
* if getattr(value, '__iter__', False):
* r = [bloom.check(&self.context, v, len(v)) for v in value] # <<<<<<<<<<<<<<
* return [v for v in value if bloom.check_next(&self.context)]
* else:
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
if (PyList_CheckExact(__pyx_v_value) || PyTuple_CheckExact(__pyx_v_value)) {
__pyx_t_2 = __pyx_v_value; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
__pyx_t_6 = NULL;
} else {
- __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -1043,7 +1043,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_6contains(PyObject *__pyx_v_self
if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -1052,11 +1052,11 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_6contains(PyObject *__pyx_v_self
__Pyx_XDECREF(__pyx_v_v);
__pyx_v_v = __pyx_t_1;
__pyx_t_1 = 0;
- __pyx_t_7 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = __Pyx_PyBool_FromLong(check((&((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->context), __pyx_t_7, __pyx_t_8)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(check((&((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->context), __pyx_t_7, __pyx_t_8)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (unlikely(PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __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;
@@ -1064,7 +1064,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_6contains(PyObject *__pyx_v_self
__pyx_v_r = __pyx_t_3;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- /* "pyreBloom.pyx":46
+ /* "pyreBloom.pyx":67
* if getattr(value, '__iter__', False):
* r = [bloom.check(&self.context, v, len(v)) for v in value]
* return [v for v in value if bloom.check_next(&self.context)] # <<<<<<<<<<<<<<
@@ -1072,13 +1072,13 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_6contains(PyObject *__pyx_v_self
* bloom.check(&self.context, value, len(value))
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
if (PyList_CheckExact(__pyx_v_value) || PyTuple_CheckExact(__pyx_v_value)) {
__pyx_t_2 = __pyx_v_value; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
__pyx_t_6 = NULL;
} else {
- __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -1094,7 +1094,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_6contains(PyObject *__pyx_v_self
if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -1105,7 +1105,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_6contains(PyObject *__pyx_v_self
__pyx_t_1 = 0;
__pyx_t_4 = check_next((&((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->context));
if (__pyx_t_4) {
- if (unlikely(PyList_Append(__pyx_t_3, (PyObject*)__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyList_Append(__pyx_t_3, (PyObject*)__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L10;
}
__pyx_L10:;
@@ -1119,18 +1119,18 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_6contains(PyObject *__pyx_v_self
}
/*else*/ {
- /* "pyreBloom.pyx":48
+ /* "pyreBloom.pyx":69
* return [v for v in value if bloom.check_next(&self.context)]
* else:
* bloom.check(&self.context, value, len(value)) # <<<<<<<<<<<<<<
* return bool(bloom.check_next(&self.context))
*
*/
- __pyx_t_7 = PyBytes_AsString(__pyx_v_value); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyBytes_AsString(__pyx_v_value); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
check((&((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->context), __pyx_t_7, __pyx_t_5);
- /* "pyreBloom.pyx":49
+ /* "pyreBloom.pyx":70
* else:
* bloom.check(&self.context, value, len(value))
* return bool(bloom.check_next(&self.context)) # <<<<<<<<<<<<<<
@@ -1139,7 +1139,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_6contains(PyObject *__pyx_v_self
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = check_next((&((struct __pyx_obj_9pyreBloom_pyreBloom *)__pyx_v_self)->context));
- __pyx_t_3 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
@@ -1163,7 +1163,7 @@ static PyObject *__pyx_pf_9pyreBloom_9pyreBloom_6contains(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "pyreBloom.pyx":51
+/* "pyreBloom.pyx":72
* return bool(bloom.check_next(&self.context))
*
* def __contains__(self, value): # <<<<<<<<<<<<<<
@@ -1183,23 +1183,23 @@ static int __pyx_pf_9pyreBloom_9pyreBloom_7__contains__(PyObject *__pyx_v_self,
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__contains__");
- /* "pyreBloom.pyx":52
+ /* "pyreBloom.pyx":73
*
* def __contains__(self, value):
* return self.contains(value) # <<<<<<<<<<<<<<
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__contains); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__contains); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __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 = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__Pyx_INCREF(__pyx_v_value);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value);
__Pyx_GIVEREF(__pyx_v_value);
- __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 = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 73; __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_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
goto __pyx_L0;
@@ -1547,39 +1547,42 @@ PyMODINIT_FUNC PyInit_pyreBloom(void)
/*--- Variable export code ---*/
/*--- Function export code ---*/
/*--- Type init code ---*/
- if (PyType_Ready(&__pyx_type_9pyreBloom_pyreBloom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "pyreBloom", (PyObject *)&__pyx_type_9pyreBloom_pyreBloom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_9pyreBloom_pyreBloom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "pyreBloom", (PyObject *)&__pyx_type_9pyreBloom_pyreBloom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_9pyreBloom_pyreBloom = &__pyx_type_9pyreBloom_pyreBloom;
/*--- Type import code ---*/
/*--- Variable import code ---*/
/*--- Function import code ---*/
/*--- Execution code ---*/
- /* "pyreBloom.pyx":1
+ /* "pyreBloom.pyx":22
+ * # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
* import math # <<<<<<<<<<<<<<
* import random
*
*/
- __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__math), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__math), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__math, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__math, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pyreBloom.pyx":2
+ /* "pyreBloom.pyx":23
+ *
* import math
* import random # <<<<<<<<<<<<<<
*
* cimport bloom
*/
- __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__random), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__random), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__random, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__random, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "pyreBloom.pyx":1
- * import math # <<<<<<<<<<<<<<
- * import random
- *
+ * # Copyright (c) 2011 SEOmoz # <<<<<<<<<<<<<<
+ * #
+ * # Permission is hereby granted, free of charge, to any person obtaining
*/
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
View
21 pyreBloom/pyreBloom.pyx
@@ -1,3 +1,24 @@
+# Copyright (c) 2011 SEOmoz
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
import math
import random
View
1  setup.py
@@ -29,7 +29,6 @@
'License :: OSI Approved :: MIT License',
'Programming Language :: C',
'Programming Language :: Cython',
- 'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
**kwargs
Please sign in to comment.
Something went wrong with that request. Please try again.