snap-stanford/snap-python — pull request #12 by nshelly (2013-05-29 07:30:27+00:00)
Title: Added SWIG typemaps to convert Python primitive types to SNAP.

Using SWIG typemaps, we convert the Python primitives, a list or a string, to C++ functions, while using the SNAP for the backend. This also works for outputing Python primitives.

So, here is a comparison of the two methods, 2 and 3. Also, there is a Python optimization in C, called, PySequence_Fast_GET_ITEM, which I used for a second version of 3. This is less secure in that I am not checking each value to make sure it's an integer, but it's significant significantly faster. This is in the snap.i interface file.