Normally, when using an interface file for python like this:
the variable a is available in python via the command:
and has by default read and write access.
When using the the %immutable directive such as:
SWIG actually creates a example.cvar.a which is effectively read-only (that's what it's suppose to do)
but also create a another, separate variable example.a which has read-write permissions (not good at all !):
>>> import example
>>> example.cvar.a = 3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: Variable a is read-only.
>>> example.a = 3