I've got a struct that has a vector<string> field, and I'm trying to expose it as a python list, i.e. I would like to be able to:

s.amounts = ['a', 'b', 'c'] 

in python. 

The thing is that is WAS WORKING, I moved some things around in some header files, and now swig just wants to wrap the vector<string> as an object and not let it be converted to a python string, i.e. I get TypeError, see snippet (1) below.

My full .i is at 

but the relevant bits are my struct looks like:

struct SimulateOptions
    // stuff
    std::vector<std::string> amounts;

The .i looks basically like:

    // include files...
    using namespace rr;

%include "std_vector.i"

// define templates, make sure we get both string and std::string, 
// header files are sloppy with using namespace std
%template(StringVector2) std::vector<string>;
%template(StringVector4) std::vector<std::string>;

// the struct is in this file included first
%include <rrRoadRunnerOptions.h>

// %include a few more files and %extend an non-related class

Any help would be greatly appreciated.

* Snippet (1)
In [5]: s.amounts = ['a']
TypeError                                 Traceback (most recent call last)
<ipython-input-5-3ec04abf7373> in <module>()
----> 1 s.amounts = ['a']

/Users/andy/.local/lib/Python/roadrunner.py in <lambda>(self, name, value)
    272 class SimulateOptions(_object):
    273     __swig_setmethods__ = {}
--> 274     __setattr__ = lambda self, name, value: _swig_setattr(self, SimulateOptions, name, value)
    275     __swig_getmethods__ = {}
    276     __getattr__ = lambda self, name: _swig_getattr(self, SimulateOptions, name)

/Users/andy/.local/lib/Python/roadrunner.py in _swig_setattr(self, class_type, name, value)
     53 def _swig_setattr(self,class_type,name,value):
---> 54     return _swig_setattr_nondynamic(self,class_type,name,value,0)
     56 def _swig_getattr(self,class_type,name):

/Users/andy/.local/lib/Python/roadrunner.py in _swig_setattr_nondynamic(self, class_type, name, value, static)
     45             return
     46     method = class_type.__swig_setmethods__.get(name,None)
---> 47     if method: return method(self,value)
     48     if (not static):
     49         self.__dict__[name] = value

TypeError: in method 'SimulateOptions_amounts_set', argument 2 of type 'std::vector< std::string,std::allocator< std::string > > *'