SWIG has problems correctly generating/handling STL iterators (or in general any iterators) 
Once there are more than one SWIG-generated modules loaded in Python and each of those modules contains STL containers
then iterators generated by SWIG () like those returneb by itervalues, iter, iterator iterkeys etc) will caus segfault during iteration
This is well documented below and here:

http://permalink.gmane.org/gmane.comp.programming.swig.devel/20140 
//here is a reference found on the web to the bug in Swig
// # 1. Workaround for SWIG bug #1863647: Ensure that the PySwigIterator class
// #    (SwigPyIterator in 1.3.38 or later) is renamed with a module-specific
// #    prefix, to avoid collisions when using multiple modules
// # 2. If module names contain '.' characters, SWIG emits these into the CPP
// #    macros used in the director header. Work around this by replacing them
// #    with '_'. A longer term fix is not to call our modules "IMP.foo" but
// #    to say %module(package=IMP) foo but this doesn't work in SWIG stable
// #    as of 1.3.36 (Python imports incorrectly come out as 'import foo'
// #    rather than 'import IMP.foo'). See also IMP bug #41 at
// #    https://salilab.org/imp/bugs/show_bug.cgi?id=41

The bottom line is that instead of relying on SWIG to generate iterators for you it is much better to write your own iterator wrapper like the one included 
in the CC3D code.
This is a bit of the overhead but not too much and if necessary it can be further simplified (for the convenience of coding)