turns out there' good causethe library' putenv wants string of the form "user=gilliganto be passedwhich becomes part of the environment in codethis means we must create new piece of memory to pass inwe used malloc in example - to satisfy this constraint howeverthere' no simple and direct way to guarantee this on the python side of the fence in prior python releaseit was apparently sufficient to hold on to the string passed to putenv in temporary python variablebut this no longer works with python and/or swig fix may require either custom function or swig' typemaps which allow its handling of data translations to be customized in the interest of spacewe'll leave addressing this as suggested exercisesee swig for details wrapping +classes with swig so far in this we've been dealing with extension modules--flat function libraries to implement multiple-instance objects in cyou need to code extension typenot module like python classesc types generate multiple-instance objects and can overload ( intercept and implementpython expression operators and type operations types can also support subclassing just like python classeslargely because the type/class distinction has largely evaporated in python you can see what types look like in python' own source library treelook for the objects directory there the code required for type can be large--it defines instance creationnamed methodsoperator implementationsan iterator typeand so onand links all these together with tables--but is largely boilerplate code that is structurally the same for most types you can code new object types in manually like thisand in some applicationsthis approach may make sense but you don' necessarily have to--because swig knows how to generate glue code for +classesyou can instead automatically generate all the extension and wrapper class code required to integrate such an objectsimply by running swig over an appropriate class declaration the wrapped +class provides multiple-instance datatype much like the extension typebut it can be substantially simpler for you to code because swig handles language integration details here' how--given +class declaration and special command-line settingsswig generates the followinga ++-coded python extension module with accessor functions that interface with the +class' methods and members python-coded module with wrapper class (called "shadowor "proxyclass in swig-speakthat interfaces with the +class accessor functions module python/ integration