Commits

James Taylor committed 9b0f570

Bitsets now aggressively check all their arguments.

  • Participants
  • Parent commits e12fc76

Comments (0)

Files changed (4)

-/* Generated by Pyrex 0.9.3.1 on Fri Jan  4 16:06:50 2008 */
-
+/* Generated by Cython 0.9.6.14 on Tue May 13 13:59:56 2008 */
+
+#define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #include "structmember.h"
 #ifndef PY_LONG_LONG
   #define PY_LONG_LONG LONG_LONG
 #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 PyInt_FromSsize_t(z) PyInt_FromLong(z)
+  #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
+  #define PyNumber_Index(o)    PyNumber_Int(o)
+  #define PyIndex_Check(o)     PyNumber_Check(o)
+#endif
+#if PY_VERSION_HEX < 0x02040000
+  #define METH_COEXIST 0
+#endif
+#ifndef __stdcall
+  #define __stdcall
+#endif
+#ifndef __cdecl
+  #define __cdecl
+#endif
+#ifdef __cplusplus
+#define __PYX_EXTERN_C extern "C"
+#else
+#define __PYX_EXTERN_C extern
+#endif
+#include <math.h>
 #include "common.h"
 #include "bits.h"
 #include "binBits.h"
 
 
+#ifdef __GNUC__
+#define INLINE __inline__
+#elif _WIN32
+#define INLINE __inline
+#else
+#define INLINE 
+#endif
+
 typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
-typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
-static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/
-static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
-static int __Pyx_PrintItem(PyObject *); /*proto*/
-static int __Pyx_PrintNewline(void); /*proto*/
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static void __Pyx_ReRaise(void); /*proto*/
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
-static PyObject *__Pyx_GetExcValue(void); /*proto*/
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
-static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
-static void __Pyx_WriteUnraisable(char *name); /*proto*/
-static void __Pyx_AddTraceback(char *funcname); /*proto*/
-static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size);  /*proto*/
-static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
-static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
-static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
-static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
-
+typedef struct {PyObject **p; char *s; long n; int is_unicode;} __Pyx_StringTabEntry; /*proto*/
+
+
+
+static int __pyx_skip_dispatch = 0;
+
+
+/* Type Conversion Predeclarations */
+
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static INLINE int __Pyx_PyObject_IsTrue(PyObject* x);
+static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x);
+static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x);
+static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b);
+
+#define __pyx_PyInt_AsLong(x) (PyInt_CheckExact(x) ? PyInt_AS_LONG(x) : PyInt_AsLong(x))
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+
+static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x);
+static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x);
+static INLINE char __pyx_PyInt_char(PyObject* x);
+static INLINE short __pyx_PyInt_short(PyObject* x);
+static INLINE int __pyx_PyInt_int(PyObject* x);
+static INLINE long __pyx_PyInt_long(PyObject* x);
+static INLINE signed char __pyx_PyInt_signed_char(PyObject* x);
+static INLINE signed short __pyx_PyInt_signed_short(PyObject* x);
+static INLINE signed int __pyx_PyInt_signed_int(PyObject* x);
+static INLINE signed long __pyx_PyInt_signed_long(PyObject* x);
+static INLINE long double __pyx_PyInt_long_double(PyObject* 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 int __pyx_lineno;
+static int __pyx_clineno = 0;
+static char * __pyx_cfilenm= __FILE__;
 static char *__pyx_filename;
-staticforward char **__pyx_f;
-
-static char __pyx_mdoc[] = "\nCompact mutable sequences of bits (vectors of 0s and 1s) supporting various\nboolean operations, and a \"binned\" variation which stores long runs of \nidentical bits compactly.\n\nBecause the binned implementation avoids a lot of memory allocation and access\nwhen working with either small subregions of the total interval or setting /\ntesting spans larger than the bin size, it an be much faster.\n";
-
-/* Declarations from bitset */
-
-staticforward PyTypeObject __pyx_type_6bitset_BitSet;
-
-struct __pyx_obj_6bitset_BitSet {
+static char **__pyx_f;
+
+static char __pyx_mdoc[] = "\nCompact mutable sequences of bits (vectors of 0s and 1s) supporting various\nboolean operations, and a \"binned\" variation which stores long runs of \nidentical bits compactly.\n\nBecause the binned implementation avoids a lot of memory allocation and access\nwhen working with either small subregions of the total interval or setting /\ntesting spans larger than the bin size, it can be much faster.\n";
+
+static INLINE void __Pyx_RaiseArgtupleTooLong(Py_ssize_t num_expected, Py_ssize_t num_found); /*proto*/
+
+static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name, int exact); /*proto*/
+
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+
+static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+
+static void __Pyx_AddTraceback(char *funcname); /*proto*/
+
+/* Declarations */
+
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":71
+ * 
+ * cdef class BitSet
+ * cdef class BinnedBitSet             # <<<<<<<<<<<<<< 
+ * 
+ * ## ---- BitSet bounds checking ----------------------------------------------
+ */
+
+struct __pyx_obj_2bx_6bitset_BinnedBitSet {
   PyObject_HEAD
-  Bits (*bits);
+  struct BinBits *bb;
+};
+
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":70
+ * ## ---- Forward declerations ------------------------------------------------
+ * 
+ * cdef class BitSet             # <<<<<<<<<<<<<< 
+ * cdef class BinnedBitSet
+ * 
+ */
+
+struct __pyx_obj_2bx_6bitset_BitSet {
+  PyObject_HEAD
+  Bits *bits;
   int bitCount;
 };
 
-staticforward PyTypeObject __pyx_type_6bitset_BinnedBitSet;
-
-struct __pyx_obj_6bitset_BinnedBitSet {
-  PyObject_HEAD
-  struct BinBits (*bb);
-};
-
-static PyTypeObject *__pyx_ptype_6bitset_BitSet = 0;
-static PyTypeObject *__pyx_ptype_6bitset_BinnedBitSet = 0;
-static PyObject *__pyx_k1;
-static PyObject *__pyx_k2;
-static PyObject *__pyx_k3;
-static PyObject *__pyx_k4;
-static int __pyx_k5;
-static int __pyx_k6;
-
-/* Implementation of bitset */
-
+static PyTypeObject *__pyx_ptype_2bx_6bitset_BitSet = 0;
+static PyTypeObject *__pyx_ptype_2bx_6bitset_BinnedBitSet = 0;
+static int __pyx_v_2bx_6bitset_MAX_INT;
+static PyObject *__pyx_k_1;
+static PyObject *__pyx_f_2bx_6bitset_b_check_index(struct __pyx_obj_2bx_6bitset_BitSet *, PyObject *); /*proto*/
+static PyObject *__pyx_f_2bx_6bitset_b_check_range(struct __pyx_obj_2bx_6bitset_BitSet *, PyObject *, PyObject *); /*proto*/
+static PyObject *__pyx_f_2bx_6bitset_b_check_range_count(struct __pyx_obj_2bx_6bitset_BitSet *, PyObject *, PyObject *); /*proto*/
+static PyObject *__pyx_f_2bx_6bitset_b_check_same_size(struct __pyx_obj_2bx_6bitset_BitSet *, struct __pyx_obj_2bx_6bitset_BitSet *); /*proto*/
+static PyObject *__pyx_f_2bx_6bitset_bb_check_index(struct __pyx_obj_2bx_6bitset_BinnedBitSet *, PyObject *); /*proto*/
+static PyObject *__pyx_f_2bx_6bitset_bb_check_start(struct __pyx_obj_2bx_6bitset_BinnedBitSet *, PyObject *); /*proto*/
+static PyObject *__pyx_f_2bx_6bitset_bb_check_range_count(struct __pyx_obj_2bx_6bitset_BinnedBitSet *, PyObject *, PyObject *); /*proto*/
+static PyObject *__pyx_f_2bx_6bitset_bb_check_same_size(struct __pyx_obj_2bx_6bitset_BinnedBitSet *, struct __pyx_obj_2bx_6bitset_BinnedBitSet *); /*proto*/
+
+
+/* Implementation of bx.bitset */
+
+
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1024;
+
+static PyObject *__pyx_n___cinit__;
+static PyObject *__pyx_n___dealloc__;
+static PyObject *__pyx_n_set;
+static PyObject *__pyx_n_clear;
+static PyObject *__pyx_n_clone;
+static PyObject *__pyx_n_set_range;
+static PyObject *__pyx_n_get;
+static PyObject *__pyx_n_count_range;
+static PyObject *__pyx_n_next_set;
+static PyObject *__pyx_n_next_clear;
+static PyObject *__pyx_n_iand;
+static PyObject *__pyx_n_ior;
+static PyObject *__pyx_n_ixor;
+static PyObject *__pyx_n_invert;
+static PyObject *__pyx_n___getitem__;
+static PyObject *__pyx_n___iand__;
+static PyObject *__pyx_n___ior__;
+static PyObject *__pyx_n___invert__;
+static PyObject *__pyx_n___dealloc;
 static PyObject *__pyx_n_MAX;
 
-static int __pyx_f_6bitset_6BitSet___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_f_6bitset_6BitSet___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  int __pyx_v_bitCount;
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":75
+ * ## ---- BitSet bounds checking ----------------------------------------------
+ *     
+ * cdef inline b_check_index( BitSet b, index ):             # <<<<<<<<<<<<<< 
+ *     if index < 0:
+ *         raise IndexError( "BitSet index (%d) must be non-negative." % index )
+ */
+
+static PyObject *__pyx_n_IndexError;
+
+static PyObject *__pyx_k_2p;
+static PyObject *__pyx_k_3p;
+
+static PyObject *__pyx_builtin_IndexError;
+
+static char __pyx_k_2[] = "BitSet index (%d) must be non-negative.";
+static char __pyx_k_3[] = "%d is larger than the size of this BitSet (%d).";
+
+static INLINE PyObject *__pyx_f_2bx_6bitset_b_check_index(struct __pyx_obj_2bx_6bitset_BitSet *__pyx_v_b, PyObject *__pyx_v_index) {
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  int __pyx_2;
+  PyObject *__pyx_3 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":76
+ *     
+ * cdef inline b_check_index( BitSet b, index ):
+ *     if index < 0:             # <<<<<<<<<<<<<< 
+ *         raise IndexError( "BitSet index (%d) must be non-negative." % index )
+ *     if index >= b.bitCount:
+ */
+  __pyx_1 = PyObject_RichCompare(__pyx_v_index, __pyx_int_0, Py_LT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  if (__pyx_2) {
+
+    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":77
+ * cdef inline b_check_index( BitSet b, index ):
+ *     if index < 0:
+ *         raise IndexError( "BitSet index (%d) must be non-negative." % index )             # <<<<<<<<<<<<<< 
+ *     if index >= b.bitCount:
+ *         raise IndexError( "%d is larger than the size of this BitSet (%d)." % ( index, b.bitCount ) )
+ */
+    __pyx_1 = PyNumber_Remainder(__pyx_k_2p, __pyx_v_index); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
+    __pyx_1 = 0;
+    __pyx_1 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
+    __Pyx_Raise(__pyx_1, 0, 0);
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    goto __pyx_L2;
+  }
+  __pyx_L2:;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":78
+ *     if index < 0:
+ *         raise IndexError( "BitSet index (%d) must be non-negative." % index )
+ *     if index >= b.bitCount:             # <<<<<<<<<<<<<< 
+ *         raise IndexError( "%d is larger than the size of this BitSet (%d)." % ( index, b.bitCount ) )
+ *     
+ */
+  __pyx_3 = PyInt_FromLong(__pyx_v_b->bitCount); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_1 = PyObject_RichCompare(__pyx_v_index, __pyx_3, Py_GE); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  if (__pyx_2) {
+
+    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":79
+ *         raise IndexError( "BitSet index (%d) must be non-negative." % index )
+ *     if index >= b.bitCount:
+ *         raise IndexError( "%d is larger than the size of this BitSet (%d)." % ( index, b.bitCount ) )             # <<<<<<<<<<<<<< 
+ *     
+ * cdef inline b_check_range( BitSet b, start, end ):
+ */
+    __pyx_3 = PyInt_FromLong(__pyx_v_b->bitCount); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_INCREF(__pyx_v_index);
+    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_index);
+    PyTuple_SET_ITEM(__pyx_1, 1, __pyx_3);
+    __pyx_3 = 0;
+    __pyx_3 = PyNumber_Remainder(__pyx_k_3p, ((PyObject *)__pyx_1)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
+    __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
+    __pyx_3 = 0;
+    __pyx_3 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
+    __Pyx_Raise(__pyx_3, 0, 0);
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    goto __pyx_L3;
+  }
+  __pyx_L3:;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("bx.bitset.b_check_index");
+  __pyx_r = 0;
+  __pyx_L0:;
+  return __pyx_r;
+}
+
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":81
+ *         raise IndexError( "%d is larger than the size of this BitSet (%d)." % ( index, b.bitCount ) )
+ *     
+ * cdef inline b_check_range( BitSet b, start, end ):             # <<<<<<<<<<<<<< 
+ *     b_check_index( b, start )
+ *     if end < start:
+ */
+
+static PyObject *__pyx_k_4p;
+static PyObject *__pyx_k_5p;
+
+static char __pyx_k_4[] = "Range end (%d) must be greater than range start(%d).";
+static char __pyx_k_5[] = "End %d is larger than the size of this BitSet (%d).";
+
+static INLINE PyObject *__pyx_f_2bx_6bitset_b_check_range(struct __pyx_obj_2bx_6bitset_BitSet *__pyx_v_b, PyObject *__pyx_v_start, PyObject *__pyx_v_end) {
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  int __pyx_2;
+  PyObject *__pyx_3 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":82
+ *     
+ * cdef inline b_check_range( BitSet b, start, end ):
+ *     b_check_index( b, start )             # <<<<<<<<<<<<<< 
+ *     if end < start:
+ *         raise IndexError( "Range end (%d) must be greater than range start(%d)." % ( end, start ) )
+ */
+  __pyx_1 = __pyx_f_2bx_6bitset_b_check_index(__pyx_v_b, __pyx_v_start); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":83
+ * cdef inline b_check_range( BitSet b, start, end ):
+ *     b_check_index( b, start )
+ *     if end < start:             # <<<<<<<<<<<<<< 
+ *         raise IndexError( "Range end (%d) must be greater than range start(%d)." % ( end, start ) )
+ *     if end > b.bitCount:
+ */
+  __pyx_1 = PyObject_RichCompare(__pyx_v_end, __pyx_v_start, Py_LT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  if (__pyx_2) {
+
+    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":84
+ *     b_check_index( b, start )
+ *     if end < start:
+ *         raise IndexError( "Range end (%d) must be greater than range start(%d)." % ( end, start ) )             # <<<<<<<<<<<<<< 
+ *     if end > b.bitCount:
+ *         raise IndexError( "End %d is larger than the size of this BitSet (%d)." % ( end, b.bitCount ) )
+ */
+    __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_INCREF(__pyx_v_end);
+    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_end);
+    Py_INCREF(__pyx_v_start);
+    PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_start);
+    __pyx_3 = PyNumber_Remainder(__pyx_k_4p, ((PyObject *)__pyx_1)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
+    __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
+    __pyx_3 = 0;
+    __pyx_3 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
+    __Pyx_Raise(__pyx_3, 0, 0);
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    goto __pyx_L2;
+  }
+  __pyx_L2:;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":85
+ *     if end < start:
+ *         raise IndexError( "Range end (%d) must be greater than range start(%d)." % ( end, start ) )
+ *     if end > b.bitCount:             # <<<<<<<<<<<<<< 
+ *         raise IndexError( "End %d is larger than the size of this BitSet (%d)." % ( end, b.bitCount ) )
+ *         
+ */
+  __pyx_1 = PyInt_FromLong(__pyx_v_b->bitCount); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_3 = PyObject_RichCompare(__pyx_v_end, __pyx_1, Py_GT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  if (__pyx_2) {
+
+    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":86
+ *         raise IndexError( "Range end (%d) must be greater than range start(%d)." % ( end, start ) )
+ *     if end > b.bitCount:
+ *         raise IndexError( "End %d is larger than the size of this BitSet (%d)." % ( end, b.bitCount ) )             # <<<<<<<<<<<<<< 
+ *         
+ * cdef inline b_check_range_count( BitSet b, start, count ):
+ */
+    __pyx_1 = PyInt_FromLong(__pyx_v_b->bitCount); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_INCREF(__pyx_v_end);
+    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_end);
+    PyTuple_SET_ITEM(__pyx_3, 1, __pyx_1);
+    __pyx_1 = 0;
+    __pyx_1 = PyNumber_Remainder(__pyx_k_5p, ((PyObject *)__pyx_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
+    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
+    __pyx_1 = 0;
+    __pyx_1 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
+    __Pyx_Raise(__pyx_1, 0, 0);
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    goto __pyx_L3;
+  }
+  __pyx_L3:;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("bx.bitset.b_check_range");
+  __pyx_r = 0;
+  __pyx_L0:;
+  return __pyx_r;
+}
+
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":88
+ *         raise IndexError( "End %d is larger than the size of this BitSet (%d)." % ( end, b.bitCount ) )
+ *         
+ * cdef inline b_check_range_count( BitSet b, start, count ):             # <<<<<<<<<<<<<< 
+ *     b_check_index( b, start )
+ *     if count < 0:
+ */
+
+static PyObject *__pyx_k_6p;
+static PyObject *__pyx_k_7p;
+
+static char __pyx_k_6[] = "Count (%d) must be non-negative.";
+static char __pyx_k_7[] = "End %d is larger than the size of this BitSet (%d).";
+
+static INLINE PyObject *__pyx_f_2bx_6bitset_b_check_range_count(struct __pyx_obj_2bx_6bitset_BitSet *__pyx_v_b, PyObject *__pyx_v_start, PyObject *__pyx_v_count) {
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  int __pyx_2;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":89
+ *         
+ * cdef inline b_check_range_count( BitSet b, start, count ):
+ *     b_check_index( b, start )             # <<<<<<<<<<<<<< 
+ *     if count < 0:
+ *         raise IndexError( "Count (%d) must be non-negative." % count )
+ */
+  __pyx_1 = __pyx_f_2bx_6bitset_b_check_index(__pyx_v_b, __pyx_v_start); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":90
+ * cdef inline b_check_range_count( BitSet b, start, count ):
+ *     b_check_index( b, start )
+ *     if count < 0:             # <<<<<<<<<<<<<< 
+ *         raise IndexError( "Count (%d) must be non-negative." % count )
+ *     if start + count > b.bitCount:
+ */
+  __pyx_1 = PyObject_RichCompare(__pyx_v_count, __pyx_int_0, Py_LT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  if (__pyx_2) {
+
+    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":91
+ *     b_check_index( b, start )
+ *     if count < 0:
+ *         raise IndexError( "Count (%d) must be non-negative." % count )             # <<<<<<<<<<<<<< 
+ *     if start + count > b.bitCount:
+ *         raise IndexError( "End %d is larger than the size of this BitSet (%d)." % ( start + count, b.bitCount ) )
+ */
+    __pyx_1 = PyNumber_Remainder(__pyx_k_6p, __pyx_v_count); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
+    __pyx_1 = 0;
+    __pyx_1 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
+    __Pyx_Raise(__pyx_1, 0, 0);
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    goto __pyx_L2;
+  }
+  __pyx_L2:;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":92
+ *     if count < 0:
+ *         raise IndexError( "Count (%d) must be non-negative." % count )
+ *     if start + count > b.bitCount:             # <<<<<<<<<<<<<< 
+ *         raise IndexError( "End %d is larger than the size of this BitSet (%d)." % ( start + count, b.bitCount ) )
+ * 
+ */
+  __pyx_3 = PyNumber_Add(__pyx_v_start, __pyx_v_count); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_1 = PyInt_FromLong(__pyx_v_b->bitCount); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_4 = PyObject_RichCompare(__pyx_3, __pyx_1, Py_GT); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_4); __pyx_4 = 0;
+  if (__pyx_2) {
+
+    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":93
+ *         raise IndexError( "Count (%d) must be non-negative." % count )
+ *     if start + count > b.bitCount:
+ *         raise IndexError( "End %d is larger than the size of this BitSet (%d)." % ( start + count, b.bitCount ) )             # <<<<<<<<<<<<<< 
+ * 
+ * cdef inline b_check_same_size( BitSet b, BitSet other ):
+ */
+    __pyx_3 = PyNumber_Add(__pyx_v_start, __pyx_v_count); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    __pyx_1 = PyInt_FromLong(__pyx_v_b->bitCount); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_1);
+    __pyx_3 = 0;
+    __pyx_1 = 0;
+    __pyx_3 = PyNumber_Remainder(__pyx_k_7p, ((PyObject *)__pyx_4)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
+    __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
+    __pyx_3 = 0;
+    __pyx_4 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
+    __Pyx_Raise(__pyx_4, 0, 0);
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    goto __pyx_L3;
+  }
+  __pyx_L3:;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_3);
+  Py_XDECREF(__pyx_4);
+  __Pyx_AddTraceback("bx.bitset.b_check_range_count");
+  __pyx_r = 0;
+  __pyx_L0:;
+  return __pyx_r;
+}
+
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":95
+ *         raise IndexError( "End %d is larger than the size of this BitSet (%d)." % ( start + count, b.bitCount ) )
+ * 
+ * cdef inline b_check_same_size( BitSet b, BitSet other ):             # <<<<<<<<<<<<<< 
+ *     if b.bitCount != other.bitCount:
+ *         raise ValueError( "BitSets must have the same size" )
+ */
+
+static PyObject *__pyx_n_ValueError;
+
+static PyObject *__pyx_k_8p;
+
+static PyObject *__pyx_builtin_ValueError;
+
+static char __pyx_k_8[] = "BitSets must have the same size";
+
+static INLINE PyObject *__pyx_f_2bx_6bitset_b_check_same_size(struct __pyx_obj_2bx_6bitset_BitSet *__pyx_v_b, struct __pyx_obj_2bx_6bitset_BitSet *__pyx_v_other) {
+  PyObject *__pyx_r;
+  int __pyx_1;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":96
+ * 
+ * cdef inline b_check_same_size( BitSet b, BitSet other ):
+ *     if b.bitCount != other.bitCount:             # <<<<<<<<<<<<<< 
+ *         raise ValueError( "BitSets must have the same size" )
+ * 
+ */
+  __pyx_1 = (__pyx_v_b->bitCount != __pyx_v_other->bitCount);
+  if (__pyx_1) {
+
+    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":97
+ * cdef inline b_check_same_size( BitSet b, BitSet other ):
+ *     if b.bitCount != other.bitCount:
+ *         raise ValueError( "BitSets must have the same size" )             # <<<<<<<<<<<<<< 
+ * 
+ * ## ---- BitSet --------------------------------------------------------------
+ */
+    __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_INCREF(__pyx_k_8p);
+    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_8p);
+    __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
+    __Pyx_Raise(__pyx_3, 0, 0);
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    goto __pyx_L2;
+  }
+  __pyx_L2:;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("bx.bitset.b_check_same_size");
+  __pyx_r = 0;
+  __pyx_L0:;
+  return __pyx_r;
+}
+
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":107
+ *     cdef Bits * bits
+ *     cdef int bitCount
+ *     def __new__( self, bitCount ):             # <<<<<<<<<<<<<< 
+ *         if bitCount > MAX_INT:
+ *             raise ValueError( "%d is larger than the maximum BitSet size of %d." % ( bitCount, MAX_INT ) )
+ */
+
+static PyObject *__pyx_k_9p;
+
+static char __pyx_k_9[] = "%d is larger than the maximum BitSet size of %d.";
+
+static int __pyx_pf_2bx_6bitset_6BitSet___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pf_2bx_6bitset_6BitSet___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_bitCount = 0;
   int __pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  int __pyx_3;
+  int __pyx_4;
   static char *__pyx_argnames[] = {"bitCount",0};
-  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_bitCount)) return -1;
-  Py_INCREF(__pyx_v_self);
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":74 */
-  ((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bitCount = __pyx_v_bitCount;
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":75 */
-  ((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bits = bitAlloc(__pyx_v_bitCount);
+  if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 1)) {
+    __pyx_v_bitCount = PyTuple_GET_ITEM(__pyx_args, 0);
+  }
+  else {
+    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_bitCount))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L2;}
+  }
+  goto __pyx_L3;
+  __pyx_L2:;
+  __Pyx_AddTraceback("bx.bitset.BitSet.__cinit__");
+  return -1;
+  __pyx_L3:;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":108
+ *     cdef int bitCount
+ *     def __new__( self, bitCount ):
+ *         if bitCount > MAX_INT:             # <<<<<<<<<<<<<< 
+ *             raise ValueError( "%d is larger than the maximum BitSet size of %d." % ( bitCount, MAX_INT ) )
+ *         self.bitCount = bitCount
+ */
+  __pyx_1 = PyInt_FromLong(__pyx_v_2bx_6bitset_MAX_INT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_2 = PyObject_RichCompare(__pyx_v_bitCount, __pyx_1, Py_GT); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  __pyx_3 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  if (__pyx_3) {
+
+    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":109
+ *     def __new__( self, bitCount ):
+ *         if bitCount > MAX_INT:
+ *             raise ValueError( "%d is larger than the maximum BitSet size of %d." % ( bitCount, MAX_INT ) )             # <<<<<<<<<<<<<< 
+ *         self.bitCount = bitCount
+ *         self.bits = bitAlloc( bitCount )
+ */
+    __pyx_1 = PyInt_FromLong(__pyx_v_2bx_6bitset_MAX_INT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_INCREF(__pyx_v_bitCount);
+    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_bitCount);
+    PyTuple_SET_ITEM(__pyx_2, 1, __pyx_1);
+    __pyx_1 = 0;
+    __pyx_1 = PyNumber_Remainder(__pyx_k_9p, ((PyObject *)__pyx_2)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
+    __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
+    __pyx_1 = 0;
+    __pyx_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
+    __Pyx_Raise(__pyx_1, 0, 0);
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    goto __pyx_L4;
+  }
+  __pyx_L4:;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":110
+ *         if bitCount > MAX_INT:
+ *             raise ValueError( "%d is larger than the maximum BitSet size of %d." % ( bitCount, MAX_INT ) )
+ *         self.bitCount = bitCount             # <<<<<<<<<<<<<< 
+ *         self.bits = bitAlloc( bitCount )
+ *     def __dealloc__( self ):
+ */
+  __pyx_4 = __pyx_PyInt_int(__pyx_v_bitCount); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  ((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bitCount = __pyx_4;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":111
+ *             raise ValueError( "%d is larger than the maximum BitSet size of %d." % ( bitCount, MAX_INT ) )
+ *         self.bitCount = bitCount
+ *         self.bits = bitAlloc( bitCount )             # <<<<<<<<<<<<<< 
+ *     def __dealloc__( self ):
+ *         bitFree( & self.bits )
+ */
+  __pyx_4 = __pyx_PyInt_int(__pyx_v_bitCount); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  ((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bits = bitAlloc(__pyx_4);
 
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1:;
-  __Pyx_AddTraceback("bitset.BitSet.__new__");
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  __Pyx_AddTraceback("bx.bitset.BitSet.__cinit__");
   __pyx_r = -1;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
   return __pyx_r;
 }
 
-static void __pyx_f_6bitset_6BitSet___dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_f_6bitset_6BitSet___dealloc__(PyObject *__pyx_v_self) {
-  Py_INCREF(__pyx_v_self);
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":78 */
-  bitFree((&((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bits));
-
-  goto __pyx_L0;
-  __pyx_L1:;
-  __Pyx_AddTraceback("bitset.BitSet.__dealloc__");
-  __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":112
+ *         self.bitCount = bitCount
+ *         self.bits = bitAlloc( bitCount )
+ *     def __dealloc__( self ):             # <<<<<<<<<<<<<< 
+ *         bitFree( & self.bits )
+ *     property size:
+ */
+
+static void __pyx_pf_2bx_6bitset_6BitSet___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pf_2bx_6bitset_6BitSet___dealloc__(PyObject *__pyx_v_self) {
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":113
+ *         self.bits = bitAlloc( bitCount )
+ *     def __dealloc__( self ):
+ *         bitFree( & self.bits )             # <<<<<<<<<<<<<< 
+ *     property size:
+ *         def __get__( self ):
+ */
+  bitFree((&((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bits));
+
 }
 
-static PyObject *__pyx_f_6bitset_6BitSet_4size___get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet_4size___get__(PyObject *__pyx_v_self) {
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":115
+ *         bitFree( & self.bits )
+ *     property size:
+ *         def __get__( self ):             # <<<<<<<<<<<<<< 
+ *             return self.bitCount
+ *     def set( self, index ):
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_4size___get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_4size___get__(PyObject *__pyx_v_self) {
   PyObject *__pyx_r;
   PyObject *__pyx_1 = 0;
-  Py_INCREF(__pyx_v_self);
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":87 */
-  __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bitCount); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":116
+ *     property size:
+ *         def __get__( self ):
+ *             return self.bitCount             # <<<<<<<<<<<<<< 
+ *     def set( self, index ):
+ *         b_check_index( self, index )
+ */
+  __pyx_1 = PyInt_FromLong(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bitCount); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1;}
   __pyx_r = __pyx_1;
   __pyx_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
-  __Pyx_AddTraceback("bitset.BitSet.size.__get__");
-  __pyx_r = 0;
+  __Pyx_AddTraceback("bx.bitset.BitSet.size.__get__");
+  __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
   return __pyx_r;
 }
 
-static PyObject *__pyx_f_6bitset_6BitSet_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_index = 0;
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":117
+ *         def __get__( self ):
+ *             return self.bitCount
+ *     def set( self, index ):             # <<<<<<<<<<<<<< 
+ *         b_check_index( self, index )
+ *         bitSetOne( self.bits, index )
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_set(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_set(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
   PyObject *__pyx_r;
-  int __pyx_1;
-  static char *__pyx_argnames[] = {"index",0};
-  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_index)) return 0;
-  Py_INCREF(__pyx_v_self);
-  Py_INCREF(__pyx_v_index);
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":90 */
-  __pyx_1 = PyInt_AsLong(__pyx_v_index); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
-  bitSetOne(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bits,__pyx_1);
-
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  PyObject *__pyx_1 = 0;
+  int __pyx_2;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":118
+ *             return self.bitCount
+ *     def set( self, index ):
+ *         b_check_index( self, index )             # <<<<<<<<<<<<<< 
+ *         bitSetOne( self.bits, index )
+ *     def clear( self, index ):
+ */
+  __pyx_1 = __pyx_f_2bx_6bitset_b_check_index(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":119
+ *     def set( self, index ):
+ *         b_check_index( self, index )
+ *         bitSetOne( self.bits, index )             # <<<<<<<<<<<<<< 
+ *     def clear( self, index ):
+ *         b_check_index( self, index )
+ */
+  __pyx_2 = __pyx_PyInt_int(__pyx_v_index); if (unlikely((__pyx_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  bitSetOne(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bits, __pyx_2);
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
-  __Pyx_AddTraceback("bitset.BitSet.set");
-  __pyx_r = 0;
+  Py_XDECREF(__pyx_1);
+  __Pyx_AddTraceback("bx.bitset.BitSet.set");
+  __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
-  Py_DECREF(__pyx_v_index);
   return __pyx_r;
 }
 
-static PyObject *__pyx_f_6bitset_6BitSet_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_index = 0;
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":120
+ *         b_check_index( self, index )
+ *         bitSetOne( self.bits, index )
+ *     def clear( self, index ):             # <<<<<<<<<<<<<< 
+ *         b_check_index( self, index )
+ *         bitClearOne( self.bits, index )
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_clear(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_clear(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
   PyObject *__pyx_r;
-  int __pyx_1;
-  static char *__pyx_argnames[] = {"index",0};
-  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_index)) return 0;
-  Py_INCREF(__pyx_v_self);
-  Py_INCREF(__pyx_v_index);
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":93 */
-  __pyx_1 = PyInt_AsLong(__pyx_v_index); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
-  bitClearOne(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bits,__pyx_1);
-
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  PyObject *__pyx_1 = 0;
+  int __pyx_2;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":121
+ *         bitSetOne( self.bits, index )
+ *     def clear( self, index ):
+ *         b_check_index( self, index )             # <<<<<<<<<<<<<< 
+ *         bitClearOne( self.bits, index )
+ *     def clone( self ):
+ */
+  __pyx_1 = __pyx_f_2bx_6bitset_b_check_index(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":122
+ *     def clear( self, index ):
+ *         b_check_index( self, index )
+ *         bitClearOne( self.bits, index )             # <<<<<<<<<<<<<< 
+ *     def clone( self ):
+ *         other = BitSet( self.bitCount )
+ */
+  __pyx_2 = __pyx_PyInt_int(__pyx_v_index); if (unlikely((__pyx_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  bitClearOne(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bits, __pyx_2);
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
-  __Pyx_AddTraceback("bitset.BitSet.clear");
-  __pyx_r = 0;
+  Py_XDECREF(__pyx_1);
+  __Pyx_AddTraceback("bx.bitset.BitSet.clear");
+  __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
-  Py_DECREF(__pyx_v_index);
   return __pyx_r;
 }
 
-static PyObject *__pyx_n_ior;
-
-static PyObject *__pyx_f_6bitset_6BitSet_clone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet_clone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":123
+ *         b_check_index( self, index )
+ *         bitClearOne( self.bits, index )
+ *     def clone( self ):             # <<<<<<<<<<<<<< 
+ *         other = BitSet( self.bitCount )
+ *         other.ior( self )
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_clone(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_clone(PyObject *__pyx_v_self, PyObject *unused) {
   PyObject *__pyx_v_other;
   PyObject *__pyx_r;
   PyObject *__pyx_1 = 0;
   PyObject *__pyx_2 = 0;
   PyObject *__pyx_3 = 0;
-  static char *__pyx_argnames[] = {0};
-  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
-  Py_INCREF(__pyx_v_self);
-  __pyx_v_other = Py_None; Py_INCREF(__pyx_v_other);
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":96 */
-  __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bitCount); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
-  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
+  __pyx_v_other = Py_None; Py_INCREF(Py_None);
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":124
+ *         bitClearOne( self.bits, index )
+ *     def clone( self ):
+ *         other = BitSet( self.bitCount )             # <<<<<<<<<<<<<< 
+ *         other.ior( self )
+ *         return other
+ */
+  __pyx_1 = PyInt_FromLong(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bitCount); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1;}
   PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
   __pyx_1 = 0;
-  __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_6bitset_BitSet), __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
-  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_1 = PyObject_Call(((PyObject*)__pyx_ptype_2bx_6bitset_BitSet), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
   Py_DECREF(__pyx_v_other);
   __pyx_v_other = __pyx_1;
   __pyx_1 = 0;
 
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":97 */
-  __pyx_2 = PyObject_GetAttr(__pyx_v_other, __pyx_n_ior); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
-  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":125
+ *     def clone( self ):
+ *         other = BitSet( self.bitCount )
+ *         other.ior( self )             # <<<<<<<<<<<<<< 
+ *         return other
+ *     def set_range( self, start, count ):
+ */
+  __pyx_2 = PyObject_GetAttr(__pyx_v_other, __pyx_n_ior); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1;}
   Py_INCREF(__pyx_v_self);
   PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
-  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
+  __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1;}
   Py_DECREF(__pyx_2); __pyx_2 = 0;
-  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
   Py_DECREF(__pyx_3); __pyx_3 = 0;
 
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":98 */
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":126
+ *         other = BitSet( self.bitCount )
+ *         other.ior( self )
+ *         return other             # <<<<<<<<<<<<<< 
+ *     def set_range( self, start, count ):
+ *         b_check_range_count( self, start, count )
+ */
   Py_INCREF(__pyx_v_other);
   __pyx_r = __pyx_v_other;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
   Py_XDECREF(__pyx_2);
   Py_XDECREF(__pyx_3);
-  __Pyx_AddTraceback("bitset.BitSet.clone");
-  __pyx_r = 0;
+  __Pyx_AddTraceback("bx.bitset.BitSet.clone");
+  __pyx_r = NULL;
   __pyx_L0:;
   Py_DECREF(__pyx_v_other);
-  Py_DECREF(__pyx_v_self);
   return __pyx_r;
 }
 
-static PyObject *__pyx_f_6bitset_6BitSet_set_range(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet_set_range(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":127
+ *         other.ior( self )
+ *         return other
+ *     def set_range( self, start, count ):             # <<<<<<<<<<<<<< 
+ *         b_check_range_count( self, start, count )
+ *         bitSetRange( self.bits, start, count )
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_set_range(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_set_range(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_start = 0;
   PyObject *__pyx_v_count = 0;
   PyObject *__pyx_r;
-  int __pyx_1;
+  PyObject *__pyx_1 = 0;
   int __pyx_2;
+  int __pyx_3;
   static char *__pyx_argnames[] = {"start","count",0};
-  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_start, &__pyx_v_count)) return 0;
-  Py_INCREF(__pyx_v_self);
-  Py_INCREF(__pyx_v_start);
-  Py_INCREF(__pyx_v_count);
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":101 */
-  __pyx_1 = PyInt_AsLong(__pyx_v_start); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;}
-  __pyx_2 = PyInt_AsLong(__pyx_v_count); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;}
-  bitSetRange(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bits,__pyx_1,__pyx_2);
-
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 2)) {
+    __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 0);
+    __pyx_v_count = PyTuple_GET_ITEM(__pyx_args, 1);
+  }
+  else {
+    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_start, &__pyx_v_count))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L2;}
+  }
+  goto __pyx_L3;
+  __pyx_L2:;
+  __Pyx_AddTraceback("bx.bitset.BitSet.set_range");
+  return NULL;
+  __pyx_L3:;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":128
+ *         return other
+ *     def set_range( self, start, count ):
+ *         b_check_range_count( self, start, count )             # <<<<<<<<<<<<<< 
+ *         bitSetRange( self.bits, start, count )
+ *     def get( self, index ):
+ */
+  __pyx_1 = __pyx_f_2bx_6bitset_b_check_range_count(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self), __pyx_v_start, __pyx_v_count); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":129
+ *     def set_range( self, start, count ):
+ *         b_check_range_count( self, start, count )
+ *         bitSetRange( self.bits, start, count )             # <<<<<<<<<<<<<< 
+ *     def get( self, index ):
+ *         b_check_index( self, index )
+ */
+  __pyx_2 = __pyx_PyInt_int(__pyx_v_start); if (unlikely((__pyx_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_3 = __pyx_PyInt_int(__pyx_v_count); if (unlikely((__pyx_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  bitSetRange(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bits, __pyx_2, __pyx_3);
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
-  __Pyx_AddTraceback("bitset.BitSet.set_range");
-  __pyx_r = 0;
+  Py_XDECREF(__pyx_1);
+  __Pyx_AddTraceback("bx.bitset.BitSet.set_range");
+  __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
-  Py_DECREF(__pyx_v_start);
+  return __pyx_r;
+}
+
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":130
+ *         b_check_range_count( self, start, count )
+ *         bitSetRange( self.bits, start, count )
+ *     def get( self, index ):             # <<<<<<<<<<<<<< 
+ *         b_check_index( self, index )
+ *         return bitReadOne( self.bits, index );
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_get(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_get(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  int __pyx_2;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":131
+ *         bitSetRange( self.bits, start, count )
+ *     def get( self, index ):
+ *         b_check_index( self, index )             # <<<<<<<<<<<<<< 
+ *         return bitReadOne( self.bits, index );
+ *     def count_range( self, start=0, count=None ):
+ */
+  __pyx_1 = __pyx_f_2bx_6bitset_b_check_index(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":132
+ *     def get( self, index ):
+ *         b_check_index( self, index )
+ *         return bitReadOne( self.bits, index );             # <<<<<<<<<<<<<< 
+ *     def count_range( self, start=0, count=None ):
+ *         if count == None: 
+ */
+  __pyx_2 = __pyx_PyInt_int(__pyx_v_index); if (unlikely((__pyx_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_1 = PyInt_FromLong(bitReadOne(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bits, __pyx_2)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_r = __pyx_1;
+  __pyx_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  __Pyx_AddTraceback("bx.bitset.BitSet.get");
+  __pyx_r = NULL;
+  __pyx_L0:;
+  return __pyx_r;
+}
+
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":133
+ *         b_check_index( self, index )
+ *         return bitReadOne( self.bits, index );
+ *     def count_range( self, start=0, count=None ):             # <<<<<<<<<<<<<< 
+ *         if count == None: 
+ *             count = self.bitCount - start
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_count_range(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_count_range(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_start = 0;
+  PyObject *__pyx_v_count = 0;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  int __pyx_2;
+  PyObject *__pyx_3 = 0;
+  int __pyx_4;
+  int __pyx_5;
+  static char *__pyx_argnames[] = {"start","count",0};
+  __pyx_v_start = __pyx_int_0;
+  __pyx_v_count = Py_None;
+  if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) {
+    if (PyTuple_GET_SIZE(__pyx_args) > 0) {
+      __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 0);
+      if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+        __pyx_v_count = PyTuple_GET_ITEM(__pyx_args, 1);
+      }
+    }
+  }
+  else {
+    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_start, &__pyx_v_count))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L2;}
+  }
+  goto __pyx_L3;
+  __pyx_L2:;
+  __Pyx_AddTraceback("bx.bitset.BitSet.count_range");
+  return NULL;
+  __pyx_L3:;
+  Py_INCREF(__pyx_v_count);
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":134
+ *         return bitReadOne( self.bits, index );
+ *     def count_range( self, start=0, count=None ):
+ *         if count == None:             # <<<<<<<<<<<<<< 
+ *             count = self.bitCount - start
+ *         b_check_range_count( self, start, count )
+ */
+  __pyx_1 = PyObject_RichCompare(__pyx_v_count, Py_None, Py_EQ); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  if (__pyx_2) {
+
+    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":135
+ *     def count_range( self, start=0, count=None ):
+ *         if count == None: 
+ *             count = self.bitCount - start             # <<<<<<<<<<<<<< 
+ *         b_check_range_count( self, start, count )
+ *         return bitCountRange( self.bits, start, count )
+ */
+    __pyx_1 = PyInt_FromLong(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bitCount); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_v_start); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    Py_DECREF(__pyx_v_count);
+    __pyx_v_count = __pyx_3;
+    __pyx_3 = 0;
+    goto __pyx_L4;
+  }
+  __pyx_L4:;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":136
+ *         if count == None: 
+ *             count = self.bitCount - start
+ *         b_check_range_count( self, start, count )             # <<<<<<<<<<<<<< 
+ *         return bitCountRange( self.bits, start, count )
+ *     def next_set( self, start, end=None ):
+ */
+  __pyx_1 = __pyx_f_2bx_6bitset_b_check_range_count(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self), __pyx_v_start, __pyx_v_count); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":137
+ *             count = self.bitCount - start
+ *         b_check_range_count( self, start, count )
+ *         return bitCountRange( self.bits, start, count )             # <<<<<<<<<<<<<< 
+ *     def next_set( self, start, end=None ):
+ *         if end == None: 
+ */
+  __pyx_4 = __pyx_PyInt_int(__pyx_v_start); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_5 = __pyx_PyInt_int(__pyx_v_count); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_3 = PyInt_FromLong(bitCountRange(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bits, __pyx_4, __pyx_5)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_r = __pyx_3;
+  __pyx_3 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("bx.bitset.BitSet.count_range");
+  __pyx_r = NULL;
+  __pyx_L0:;
   Py_DECREF(__pyx_v_count);
   return __pyx_r;
 }
 
-static PyObject *__pyx_f_6bitset_6BitSet_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_index = 0;
-  PyObject *__pyx_r;
-  int __pyx_1;
-  PyObject *__pyx_2 = 0;
-  static char *__pyx_argnames[] = {"index",0};
-  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_index)) return 0;
-  Py_INCREF(__pyx_v_self);
-  Py_INCREF(__pyx_v_index);
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":104 */
-  __pyx_1 = PyInt_AsLong(__pyx_v_index); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
-  __pyx_2 = PyInt_FromLong(bitReadOne(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bits,__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
-  __pyx_r = __pyx_2;
-  __pyx_2 = 0;
-  goto __pyx_L0;
-
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
-  goto __pyx_L0;
-  __pyx_L1:;
-  Py_XDECREF(__pyx_2);
-  __Pyx_AddTraceback("bitset.BitSet.get");
-  __pyx_r = 0;
-  __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
-  Py_DECREF(__pyx_v_index);
-  return __pyx_r;
-}
-
-static PyObject *__pyx_f_6bitset_6BitSet_count_range(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet_count_range(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_start = 0;
-  PyObject *__pyx_v_count = 0;
-  PyObject *__pyx_r;
-  int __pyx_1;
-  PyObject *__pyx_2 = 0;
-  int __pyx_3;
-  static char *__pyx_argnames[] = {"start","count",0};
-  __pyx_v_start = __pyx_k1;
-  __pyx_v_count = __pyx_k2;
-  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_start, &__pyx_v_count)) return 0;
-  Py_INCREF(__pyx_v_self);
-  Py_INCREF(__pyx_v_start);
-  Py_INCREF(__pyx_v_count);
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":107 */
-  if (PyObject_Cmp(__pyx_v_count, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
-  __pyx_1 = __pyx_1 == 0;
-  if (__pyx_1) {
-    __pyx_2 = PyInt_FromLong(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bitCount); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
-    Py_DECREF(__pyx_v_count);
-    __pyx_v_count = __pyx_2;
-    __pyx_2 = 0;
-    goto __pyx_L2;
-  }
-  __pyx_L2:;
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":108 */
-  __pyx_1 = PyInt_AsLong(__pyx_v_start); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
-  __pyx_3 = PyInt_AsLong(__pyx_v_count); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
-  __pyx_2 = PyInt_FromLong(bitCountRange(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bits,__pyx_1,__pyx_3)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
-  __pyx_r = __pyx_2;
-  __pyx_2 = 0;
-  goto __pyx_L0;
-
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
-  goto __pyx_L0;
-  __pyx_L1:;
-  Py_XDECREF(__pyx_2);
-  __Pyx_AddTraceback("bitset.BitSet.count_range");
-  __pyx_r = 0;
-  __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
-  Py_DECREF(__pyx_v_start);
-  Py_DECREF(__pyx_v_count);
-  return __pyx_r;
-}
-
-static PyObject *__pyx_f_6bitset_6BitSet_next_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet_next_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":138
+ *         b_check_range_count( self, start, count )
+ *         return bitCountRange( self.bits, start, count )
+ *     def next_set( self, start, end=None ):             # <<<<<<<<<<<<<< 
+ *         if end == None: 
+ *             end = self.bitCount
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_next_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_next_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_start = 0;
   PyObject *__pyx_v_end = 0;
   PyObject *__pyx_r;
-  int __pyx_1;
-  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_1 = 0;
+  int __pyx_2;
   int __pyx_3;
+  int __pyx_4;
   static char *__pyx_argnames[] = {"start","end",0};
-  __pyx_v_end = __pyx_k3;
-  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_start, &__pyx_v_end)) return 0;
-  Py_INCREF(__pyx_v_self);
-  Py_INCREF(__pyx_v_start);
+  __pyx_v_end = Py_None;
+  if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) {
+    __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 0);
+    if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+      __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+  }
+  else {
+    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_start, &__pyx_v_end))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L2;}
+  }
+  goto __pyx_L3;
+  __pyx_L2:;
+  __Pyx_AddTraceback("bx.bitset.BitSet.next_set");
+  return NULL;
+  __pyx_L3:;
   Py_INCREF(__pyx_v_end);
 
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":111 */
-  if (PyObject_Cmp(__pyx_v_end, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L1;}
-  __pyx_1 = __pyx_1 == 0;
-  if (__pyx_1) {
-    __pyx_2 = PyInt_FromLong(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bitCount); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L1;}
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":139
+ *         return bitCountRange( self.bits, start, count )
+ *     def next_set( self, start, end=None ):
+ *         if end == None:             # <<<<<<<<<<<<<< 
+ *             end = self.bitCount
+ *         b_check_range( self, start, end )
+ */
+  __pyx_1 = PyObject_RichCompare(__pyx_v_end, Py_None, Py_EQ); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  if (__pyx_2) {
+
+    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":140
+ *     def next_set( self, start, end=None ):
+ *         if end == None: 
+ *             end = self.bitCount             # <<<<<<<<<<<<<< 
+ *         b_check_range( self, start, end )
+ *         return bitFindSet( self.bits, start, end )
+ */
+    __pyx_1 = PyInt_FromLong(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bitCount); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1;}
     Py_DECREF(__pyx_v_end);
-    __pyx_v_end = __pyx_2;
-    __pyx_2 = 0;
-    goto __pyx_L2;
+    __pyx_v_end = __pyx_1;
+    __pyx_1 = 0;
+    goto __pyx_L4;
   }
-  __pyx_L2:;
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":112 */
-  __pyx_1 = PyInt_AsLong(__pyx_v_start); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;}
-  __pyx_3 = PyInt_AsLong(__pyx_v_end); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;}
-  __pyx_2 = PyInt_FromLong(bitFindSet(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bits,__pyx_1,__pyx_3)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;}
-  __pyx_r = __pyx_2;
-  __pyx_2 = 0;
+  __pyx_L4:;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":141
+ *         if end == None: 
+ *             end = self.bitCount
+ *         b_check_range( self, start, end )             # <<<<<<<<<<<<<< 
+ *         return bitFindSet( self.bits, start, end )
+ *     def next_clear( self, start, end=None ):
+ */
+  __pyx_1 = __pyx_f_2bx_6bitset_b_check_range(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self), __pyx_v_start, __pyx_v_end); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":142
+ *             end = self.bitCount
+ *         b_check_range( self, start, end )
+ *         return bitFindSet( self.bits, start, end )             # <<<<<<<<<<<<<< 
+ *     def next_clear( self, start, end=None ):
+ *         if end == None: 
+ */
+  __pyx_3 = __pyx_PyInt_int(__pyx_v_start); if (unlikely((__pyx_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_4 = __pyx_PyInt_int(__pyx_v_end); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_1 = PyInt_FromLong(bitFindSet(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bits, __pyx_3, __pyx_4)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_r = __pyx_1;
+  __pyx_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
-  Py_XDECREF(__pyx_2);
-  __Pyx_AddTraceback("bitset.BitSet.next_set");
-  __pyx_r = 0;
+  Py_XDECREF(__pyx_1);
+  __Pyx_AddTraceback("bx.bitset.BitSet.next_set");
+  __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
-  Py_DECREF(__pyx_v_start);
   Py_DECREF(__pyx_v_end);
   return __pyx_r;
 }
 
-static PyObject *__pyx_f_6bitset_6BitSet_next_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet_next_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":143
+ *         b_check_range( self, start, end )
+ *         return bitFindSet( self.bits, start, end )
+ *     def next_clear( self, start, end=None ):             # <<<<<<<<<<<<<< 
+ *         if end == None: 
+ *             end = self.bitCount
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_next_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_next_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_start = 0;
   PyObject *__pyx_v_end = 0;
   PyObject *__pyx_r;
-  int __pyx_1;
-  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_1 = 0;
+  int __pyx_2;
   int __pyx_3;
+  int __pyx_4;
   static char *__pyx_argnames[] = {"start","end",0};
-  __pyx_v_end = __pyx_k4;
-  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_start, &__pyx_v_end)) return 0;
-  Py_INCREF(__pyx_v_self);
-  Py_INCREF(__pyx_v_start);
+  __pyx_v_end = Py_None;
+  if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) {
+    __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 0);
+    if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+      __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+  }
+  else {
+    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_start, &__pyx_v_end))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L2;}
+  }
+  goto __pyx_L3;
+  __pyx_L2:;
+  __Pyx_AddTraceback("bx.bitset.BitSet.next_clear");
+  return NULL;
+  __pyx_L3:;
   Py_INCREF(__pyx_v_end);
 
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":115 */
-  if (PyObject_Cmp(__pyx_v_end, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
-  __pyx_1 = __pyx_1 == 0;
-  if (__pyx_1) {
-    __pyx_2 = PyInt_FromLong(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bitCount); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":144
+ *         return bitFindSet( self.bits, start, end )
+ *     def next_clear( self, start, end=None ):
+ *         if end == None:             # <<<<<<<<<<<<<< 
+ *             end = self.bitCount
+ *         b_check_range( self, start, end )
+ */
+  __pyx_1 = PyObject_RichCompare(__pyx_v_end, Py_None, Py_EQ); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  if (__pyx_2) {
+
+    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":145
+ *     def next_clear( self, start, end=None ):
+ *         if end == None: 
+ *             end = self.bitCount             # <<<<<<<<<<<<<< 
+ *         b_check_range( self, start, end )
+ *         return bitFindClear( self.bits, start, end )
+ */
+    __pyx_1 = PyInt_FromLong(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bitCount); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1;}
     Py_DECREF(__pyx_v_end);
-    __pyx_v_end = __pyx_2;
-    __pyx_2 = 0;
-    goto __pyx_L2;
+    __pyx_v_end = __pyx_1;
+    __pyx_1 = 0;
+    goto __pyx_L4;
   }
-  __pyx_L2:;
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":116 */
-  __pyx_1 = PyInt_AsLong(__pyx_v_start); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
-  __pyx_3 = PyInt_AsLong(__pyx_v_end); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
-  __pyx_2 = PyInt_FromLong(bitFindClear(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bits,__pyx_1,__pyx_3)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
-  __pyx_r = __pyx_2;
-  __pyx_2 = 0;
+  __pyx_L4:;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":146
+ *         if end == None: 
+ *             end = self.bitCount
+ *         b_check_range( self, start, end )             # <<<<<<<<<<<<<< 
+ *         return bitFindClear( self.bits, start, end )
+ *     def iand( self, BitSet other ):
+ */
+  __pyx_1 = __pyx_f_2bx_6bitset_b_check_range(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self), __pyx_v_start, __pyx_v_end); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":147
+ *             end = self.bitCount
+ *         b_check_range( self, start, end )
+ *         return bitFindClear( self.bits, start, end )             # <<<<<<<<<<<<<< 
+ *     def iand( self, BitSet other ):
+ *         b_check_same_size( self, other )
+ */
+  __pyx_3 = __pyx_PyInt_int(__pyx_v_start); if (unlikely((__pyx_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_4 = __pyx_PyInt_int(__pyx_v_end); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_1 = PyInt_FromLong(bitFindClear(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bits, __pyx_3, __pyx_4)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_r = __pyx_1;
+  __pyx_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
-  Py_XDECREF(__pyx_2);
-  __Pyx_AddTraceback("bitset.BitSet.next_clear");
-  __pyx_r = 0;
+  Py_XDECREF(__pyx_1);
+  __Pyx_AddTraceback("bx.bitset.BitSet.next_clear");
+  __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
-  Py_DECREF(__pyx_v_start);
   Py_DECREF(__pyx_v_end);
   return __pyx_r;
 }
 
-static PyObject *__pyx_f_6bitset_6BitSet_iand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet_iand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  struct __pyx_obj_6bitset_BitSet *__pyx_v_other = 0;
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":148
+ *         b_check_range( self, start, end )
+ *         return bitFindClear( self.bits, start, end )
+ *     def iand( self, BitSet other ):             # <<<<<<<<<<<<<< 
+ *         b_check_same_size( self, other )
+ *         bitAnd( self.bits, other.bits, self.bitCount )
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_iand(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_iand(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
   PyObject *__pyx_r;
-  static char *__pyx_argnames[] = {"other",0};
-  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_other)) return 0;
-  Py_INCREF(__pyx_v_self);
-  Py_INCREF(__pyx_v_other);
-  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_6bitset_BitSet, 1, "other")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;}
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":119 */
-  bitAnd(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bits,__pyx_v_other->bits,((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bitCount);
-
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  PyObject *__pyx_1 = 0;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_2bx_6bitset_BitSet, 1, "other", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1;}
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":149
+ *         return bitFindClear( self.bits, start, end )
+ *     def iand( self, BitSet other ):
+ *         b_check_same_size( self, other )             # <<<<<<<<<<<<<< 
+ *         bitAnd( self.bits, other.bits, self.bitCount )
+ *     def ior( self, BitSet other ): 
+ */
+  __pyx_1 = __pyx_f_2bx_6bitset_b_check_same_size(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self), ((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_other)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":150
+ *     def iand( self, BitSet other ):
+ *         b_check_same_size( self, other )
+ *         bitAnd( self.bits, other.bits, self.bitCount )             # <<<<<<<<<<<<<< 
+ *     def ior( self, BitSet other ): 
+ *         b_check_same_size( self, other )
+ */
+  bitAnd(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bits, ((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_other)->bits, ((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bitCount);
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
-  __Pyx_AddTraceback("bitset.BitSet.iand");
-  __pyx_r = 0;
+  Py_XDECREF(__pyx_1);
+  __Pyx_AddTraceback("bx.bitset.BitSet.iand");
+  __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
-  Py_DECREF(__pyx_v_other);
   return __pyx_r;
 }
 
-static PyObject *__pyx_f_6bitset_6BitSet_ior(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet_ior(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  struct __pyx_obj_6bitset_BitSet *__pyx_v_other = 0;
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":151
+ *         b_check_same_size( self, other )
+ *         bitAnd( self.bits, other.bits, self.bitCount )
+ *     def ior( self, BitSet other ):             # <<<<<<<<<<<<<< 
+ *         b_check_same_size( self, other )
+ *         bitOr( self.bits, other.bits, self.bitCount )
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_ior(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_ior(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
   PyObject *__pyx_r;
-  static char *__pyx_argnames[] = {"other",0};
-  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_other)) return 0;
-  Py_INCREF(__pyx_v_self);
-  Py_INCREF(__pyx_v_other);
-  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_6bitset_BitSet, 1, "other")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":122 */
-  bitOr(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bits,__pyx_v_other->bits,((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bitCount);
-
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  PyObject *__pyx_1 = 0;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_2bx_6bitset_BitSet, 1, "other", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1;}
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":152
+ *         bitAnd( self.bits, other.bits, self.bitCount )
+ *     def ior( self, BitSet other ): 
+ *         b_check_same_size( self, other )             # <<<<<<<<<<<<<< 
+ *         bitOr( self.bits, other.bits, self.bitCount )
+ *     def ixor( self, BitSet other ): 
+ */
+  __pyx_1 = __pyx_f_2bx_6bitset_b_check_same_size(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self), ((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_other)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":153
+ *     def ior( self, BitSet other ): 
+ *         b_check_same_size( self, other )
+ *         bitOr( self.bits, other.bits, self.bitCount )             # <<<<<<<<<<<<<< 
+ *     def ixor( self, BitSet other ): 
+ *         b_check_same_size( self, other )
+ */
+  bitOr(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bits, ((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_other)->bits, ((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bitCount);
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
-  __Pyx_AddTraceback("bitset.BitSet.ior");
-  __pyx_r = 0;
+  Py_XDECREF(__pyx_1);
+  __Pyx_AddTraceback("bx.bitset.BitSet.ior");
+  __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
-  Py_DECREF(__pyx_v_other);
   return __pyx_r;
 }
 
-static PyObject *__pyx_f_6bitset_6BitSet_ixor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet_ixor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  struct __pyx_obj_6bitset_BitSet *__pyx_v_other = 0;
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":154
+ *         b_check_same_size( self, other )
+ *         bitOr( self.bits, other.bits, self.bitCount )
+ *     def ixor( self, BitSet other ):             # <<<<<<<<<<<<<< 
+ *         b_check_same_size( self, other )
+ *         bitXor( self.bits, other.bits, self.bitCount )
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_ixor(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_ixor(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
   PyObject *__pyx_r;
-  static char *__pyx_argnames[] = {"other",0};
-  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_other)) return 0;
-  Py_INCREF(__pyx_v_self);
-  Py_INCREF(__pyx_v_other);
-  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_6bitset_BitSet, 1, "other")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; goto __pyx_L1;}
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":125 */
-  bitXor(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bits,__pyx_v_other->bits,((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bitCount);
-
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  PyObject *__pyx_1 = 0;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_2bx_6bitset_BitSet, 1, "other", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1;}
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":155
+ *         bitOr( self.bits, other.bits, self.bitCount )
+ *     def ixor( self, BitSet other ): 
+ *         b_check_same_size( self, other )             # <<<<<<<<<<<<<< 
+ *         bitXor( self.bits, other.bits, self.bitCount )
+ *     def invert( self ):
+ */
+  __pyx_1 = __pyx_f_2bx_6bitset_b_check_same_size(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self), ((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_other)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":156
+ *     def ixor( self, BitSet other ): 
+ *         b_check_same_size( self, other )
+ *         bitXor( self.bits, other.bits, self.bitCount )             # <<<<<<<<<<<<<< 
+ *     def invert( self ):
+ *         bitNot( self.bits, self.bitCount)
+ */
+  bitXor(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bits, ((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_other)->bits, ((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bitCount);
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
-  __Pyx_AddTraceback("bitset.BitSet.ixor");
-  __pyx_r = 0;
+  Py_XDECREF(__pyx_1);
+  __Pyx_AddTraceback("bx.bitset.BitSet.ixor");
+  __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
-  Py_DECREF(__pyx_v_other);
   return __pyx_r;
 }
 
-static PyObject *__pyx_f_6bitset_6BitSet_invert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet_invert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":157
+ *         b_check_same_size( self, other )
+ *         bitXor( self.bits, other.bits, self.bitCount )
+ *     def invert( self ):             # <<<<<<<<<<<<<< 
+ *         bitNot( self.bits, self.bitCount)
+ *     def __getitem__( self, index ):
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_invert(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet_invert(PyObject *__pyx_v_self, PyObject *unused) {
   PyObject *__pyx_r;
-  static char *__pyx_argnames[] = {0};
-  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
-  Py_INCREF(__pyx_v_self);
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":128 */
-  bitNot(((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bits,((struct __pyx_obj_6bitset_BitSet *)__pyx_v_self)->bitCount);
-
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
-  goto __pyx_L0;
-  __pyx_L1:;
-  __Pyx_AddTraceback("bitset.BitSet.invert");
-  __pyx_r = 0;
-  __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":158
+ *         bitXor( self.bits, other.bits, self.bitCount )
+ *     def invert( self ):
+ *         bitNot( self.bits, self.bitCount)             # <<<<<<<<<<<<<< 
+ *     def __getitem__( self, index ):
+ *         return self.get( index )
+ */
+  bitNot(((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bits, ((struct __pyx_obj_2bx_6bitset_BitSet *)__pyx_v_self)->bitCount);
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   return __pyx_r;
 }
 
-static PyObject *__pyx_n_get;
-
-static PyObject *__pyx_f_6bitset_6BitSet___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":159
+ *     def invert( self ):
+ *         bitNot( self.bits, self.bitCount)
+ *     def __getitem__( self, index ):             # <<<<<<<<<<<<<< 
+ *         return self.get( index )
+ *     def __iand__( self, other ):
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
   PyObject *__pyx_r;
   PyObject *__pyx_1 = 0;
   PyObject *__pyx_2 = 0;
   PyObject *__pyx_3 = 0;
-  Py_INCREF(__pyx_v_self);
-  Py_INCREF(__pyx_v_index);
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":133 */
-  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
-  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":160
+ *         bitNot( self.bits, self.bitCount)
+ *     def __getitem__( self, index ):
+ *         return self.get( index )             # <<<<<<<<<<<<<< 
+ *     def __iand__( self, other ):
+ *         self.iand( other )
+ */
+  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1;}
   Py_INCREF(__pyx_v_index);
   PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_index);
-  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
+  __pyx_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
-  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
   __pyx_r = __pyx_3;
   __pyx_3 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
   Py_XDECREF(__pyx_2);
   Py_XDECREF(__pyx_3);
-  __Pyx_AddTraceback("bitset.BitSet.__getitem__");
-  __pyx_r = 0;
+  __Pyx_AddTraceback("bx.bitset.BitSet.__getitem__");
+  __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
-  Py_DECREF(__pyx_v_index);
   return __pyx_r;
 }
 
-static PyObject *__pyx_n_iand;
-
-static PyObject *__pyx_f_6bitset_6BitSet___iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet___iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":161
+ *     def __getitem__( self, index ):
+ *         return self.get( index )
+ *     def __iand__( self, other ):             # <<<<<<<<<<<<<< 
+ *         self.iand( other )
+ *         return self
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet___iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet___iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
   PyObject *__pyx_r;
   PyObject *__pyx_1 = 0;
   PyObject *__pyx_2 = 0;
   PyObject *__pyx_3 = 0;
-  Py_INCREF(__pyx_v_self);
-  Py_INCREF(__pyx_v_other);
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":136 */
-  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_iand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;}
-  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;}
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":162
+ *         return self.get( index )
+ *     def __iand__( self, other ):
+ *         self.iand( other )             # <<<<<<<<<<<<<< 
+ *         return self
+ *     def __ior__( self, other ):
+ */
+  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_iand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1;}
   Py_INCREF(__pyx_v_other);
   PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_other);
-  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;}
+  __pyx_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
-  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
   Py_DECREF(__pyx_3); __pyx_3 = 0;
 
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":137 */
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":163
+ *     def __iand__( self, other ):
+ *         self.iand( other )
+ *         return self             # <<<<<<<<<<<<<< 
+ *     def __ior__( self, other ):
+ *         self.ior( other )
+ */
   Py_INCREF(__pyx_v_self);
   __pyx_r = __pyx_v_self;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
   Py_XDECREF(__pyx_2);
   Py_XDECREF(__pyx_3);
-  __Pyx_AddTraceback("bitset.BitSet.__iand__");
-  __pyx_r = 0;
+  __Pyx_AddTraceback("bx.bitset.BitSet.__iand__");
+  __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
-  Py_DECREF(__pyx_v_other);
   return __pyx_r;
 }
 
-static PyObject *__pyx_f_6bitset_6BitSet___ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet___ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":164
+ *         self.iand( other )
+ *         return self
+ *     def __ior__( self, other ):             # <<<<<<<<<<<<<< 
+ *         self.ior( other )
+ *         return self
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet___ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet___ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
   PyObject *__pyx_r;
   PyObject *__pyx_1 = 0;
   PyObject *__pyx_2 = 0;
   PyObject *__pyx_3 = 0;
-  Py_INCREF(__pyx_v_self);
-  Py_INCREF(__pyx_v_other);
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":140 */
-  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_ior); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;}
-  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;}
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":165
+ *         return self
+ *     def __ior__( self, other ):
+ *         self.ior( other )             # <<<<<<<<<<<<<< 
+ *         return self
+ *     def __invert__( self ):
+ */
+  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_ior); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1;}
   Py_INCREF(__pyx_v_other);
   PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_other);
-  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;}
+  __pyx_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
-  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
   Py_DECREF(__pyx_3); __pyx_3 = 0;
 
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":141 */
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":166
+ *     def __ior__( self, other ):
+ *         self.ior( other )
+ *         return self             # <<<<<<<<<<<<<< 
+ *     def __invert__( self ):
+ *         self.invert()
+ */
   Py_INCREF(__pyx_v_self);
   __pyx_r = __pyx_v_self;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
   Py_XDECREF(__pyx_2);
   Py_XDECREF(__pyx_3);
-  __Pyx_AddTraceback("bitset.BitSet.__ior__");
-  __pyx_r = 0;
+  __Pyx_AddTraceback("bx.bitset.BitSet.__ior__");
+  __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_self);
-  Py_DECREF(__pyx_v_other);
   return __pyx_r;
 }
 
-static PyObject *__pyx_n_invert;
-
-static PyObject *__pyx_f_6bitset_6BitSet___invert__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_f_6bitset_6BitSet___invert__(PyObject *__pyx_v_self) {
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":167
+ *         self.ior( other )
+ *         return self
+ *     def __invert__( self ):             # <<<<<<<<<<<<<< 
+ *         self.invert()
+ *         return self
+ */
+
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet___invert__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pf_2bx_6bitset_6BitSet___invert__(PyObject *__pyx_v_self) {
   PyObject *__pyx_r;
   PyObject *__pyx_1 = 0;
   PyObject *__pyx_2 = 0;
-  PyObject *__pyx_3 = 0;
-  Py_INCREF(__pyx_v_self);
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":144 */
-  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_invert); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;}
-  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;}
-  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;}
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":168
+ *         return self
+ *     def __invert__( self ):
+ *         self.invert()             # <<<<<<<<<<<<<< 
+ *         return self
+ * 
+ */
+  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_invert); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
   Py_DECREF(__pyx_2); __pyx_2 = 0;
-  Py_DECREF(__pyx_3); __pyx_3 = 0;
-
-  /* "/afs/bx.psu.edu/home/greg/workspaces/galaxy/james_taylor_bx/trunk/lib/bx/bitset.pyx":145 */
+
+  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":169
+ *     def __invert__( self ):
+ *         self.invert()
+ *         return self             # <<<<<<<<<<<<<< 
+ * 
+ * ## ---- BinnedBitSet bounds checking ----------------------------------------
+ */
   Py_INCREF(__pyx_v_self);
   __pyx_r = __pyx_v_self;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
   Py_XDECREF(__pyx_2);
+  __Pyx_AddTraceback("bx.bitset.BitSet.__invert__");
+  __pyx_r = NULL;
+  __pyx_L0:;
+  return __pyx_r;
+}
+
+/* "/Users/james/projects/bx-python/code/trunk/lib/bx/bitset.pyx":173
+ * ## ---- BinnedBitSet bounds checking ----------------------------------------
+ * 
+ * cdef inline bb_check_index( BinnedBitSet bb, index ):             # <<<<<<<<<<<<<< 
+ *     if index < 0:
+ *         raise IndexError( "BitSet index (%d) must be non-negative." % index )
+ */