Attribute set within instance of a SWIG Python wrapped class are stored in SwigPyObject->dict, which tp_dictoffset slot is pointing to. However, SWIG wrapped classes did not have a __dict__ attribute. Inheriting subclasses did not get the attribute either because the SWIG wrapped classes initialize the tp_dictoffset slot: From http://bugs.python.org/issue16272: "If a type defines a nonzero tp_dictoffset, that type is responsible for defining a `__dict__` slot as part of the tp_getset structures. Failure to do so will result in the dict being inaccessible from Python via `obj.__dict__` from instances of the type or subtypes." Provide a SwigPyObject_get___dict__() function to retrieve the dict attribute or create it when it does not exist yet (it is normally created when setting attribute set), and a PyGetSetDef entry pointing to this function. |
||
|---|---|---|
| .. | ||
| allegrocl.cxx | ||
| allocate.cxx | ||
| browser.cxx | ||
| cffi.cxx | ||
| chicken.cxx | ||
| clisp.cxx | ||
| contract.cxx | ||
| csharp.cxx | ||
| d.cxx | ||
| directors.cxx | ||
| emit.cxx | ||
| go.cxx | ||
| guile.cxx | ||
| java.cxx | ||
| javascript.cxx | ||
| lang.cxx | ||
| lua.cxx | ||
| main.cxx | ||
| modula3.cxx | ||
| module.cxx | ||
| mzscheme.cxx | ||
| nested.cxx | ||
| ocaml.cxx | ||
| octave.cxx | ||
| overload.cxx | ||
| perl5.cxx | ||
| php.cxx | ||
| pike.cxx | ||
| python.cxx | ||
| r.cxx | ||
| README | ||
| ruby.cxx | ||
| s-exp.cxx | ||
| scilab.cxx | ||
| swigmain.cxx | ||
| swigmod.h | ||
| tcl8.cxx | ||
| typepass.cxx | ||
| uffi.cxx | ||
| utils.cxx | ||
| xml.cxx | ||
06/25/2002 This directory contains all of the SWIG language modules. Many of these modules contain code that dates back to SWIG1.0. The module API has changed a lot in the development releases so this is fairly messy. We're working on cleaning it up, but you'll have to bear with us until it's done. -- Dave