Menu

... and good riddance!

The decision to drop MSVC 6.0 is already bearing fruit. I've been able to implement templates (using partial specialization, which 6.0 doesn't support) to eliminate a huge amount of boilerplate for implementing Python type method and property wrappers. See python_convert.hpp, python_property.hpp and python_method.hpp if you're interested.

Now, don't get me wrong: this isn't the world's most elegant code. It's downright kludgy compared to something like Boost.Python that is able to autodetect method signatures more or less automatically. I ended up writing lots of overloads and even more specializations to handle that problem.

But while this stuff clearly is not as elegant as the Boost solution, its implementation is also not nearly as complicated and way easier to understand... and I've got it working in a few hours. My thought is that this isn't intended to be a general binding library like Boost.Python, so time invested in getting it to that level of generality wouldn't be well spent. In the meantime, what I have here should serve quite well to eliminate boilerplate.

Now I'll have to look into using it for implementing __init__() methods, and how to work it into "overload" implementations.

Posted by Kevin J Bluck 2006-12-07

Log in to post a comment.