Hi,

I'm trying to figure out how to assign C arrays generated by SWIG in Python.  However I keep getting the following error:

TypeError: 'SwigPyObject' object does not support item assignment

The .h and SWIG interface file is listed below, as well as the python code.  

Any help to clarify how to be able to assign an array from python (IE b[1] = 2) will be greatly appreciated.

thanks
amir 

File: extra.h
#ifndef EXTRA_H
#define EXTRA_H

typedef struct sA {
    int b[3];
} sA_t;

#endif /* EXTRA_H */

Swig interface file
%module example
%{
#include "extra.h"
%}
%include "extra.h"

From Python
>>> import example
>>> E = example.sA_t()
>>> E.b[1] = 1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'SwigPyObject' object does not support item assignment