[C++-sig] Boost.Python v2: object facilities updated
David Abrahams
david.abrahams at rcn.com
Wed Jun 19 22:15:14 CEST 2002
After a little testing I discovered that the object class didn't allow
certain kinds of expressions, e.g.
object f(object list_of_lists)
{
list_of_lists[0][1] = 5;
}
Basically the proxy being returned by item (operator[]) and attribute
(attr()) access functions was not defined to support all of the same
operations as the object class itself. Getting this to work was "fun" ;-),
especially since it uncovered code generation bugs in MSVC6 and GCC 2.95.x.
Next up: slicing, then list, tuple, dict, type, etc...
Two jobs I could use help with:
1. Examine places in the public interface to the rest of the project for
uses of PyObject* or handle<T> which should really be using object. Make a
proposal for appropriate interface changes.
2. Move code generated by the use of object and its proxies into the shared
library. I expect that the natural use of object instances generates a fair
amount of code in the user's extension module which could be shared,
reducing both compilation times and the size of extension modules. This job
is more ambitious and requires some understanding of the differences in
template instantiation and shared libs among different platforms/compilers.
Thanks,
Dave
+---------------------------------------------------------------+
David Abrahams
C++ Booster (http://www.boost.org) O__ ==
Pythonista (http://www.python.org) c/ /'_ ==
resume: http://users.rcn.com/abrahams/resume.html (*) \(*) ==
email: david.abrahams at rcn.com
+---------------------------------------------------------------+
More information about the Cplusplus-sig
mailing list