This is a little example of adding some python-object-like functionality to a C
structure that is SWIG-wrapped for use in python. What I've done mainly comes from this StackOverflow question, and the very useful answer, but is written here to remind me.
Say you have some C
code containing a structure like this:
/* testswig.h file */
#include <stdlib.h>
#include <stdio.h>