[C++-sig] Re: boost:python:embedding
David Abrahams
dave at boost-consulting.com
Sun May 4 00:23:04 CEST 2003
Dirk Gerrits <dirk at gerrits.homeip.net> writes:
> David Abrahams wrote:
>> Dirk Gerrits <dirk at gerrits.homeip.net> writes:
>>
>> How do you think it's going to get into the library anyway, Dirk?
>> You're going to have to submit your code, along with documentation and
>> tests. I'll certainly credit you in the acknowledgements page and
>> your name will go in the copyrights for that code so credit (or blame)
>> will still be on you! ;-)
>
> Hmm, good point Dave. :)
>
>> Anyway, I'd be delighted to have this in Boost.Python, so long as it
>> comes with docs and tests.
>
> Oh I'd be willing to update the tutorial. It would definately be a lot
> shorter with this code in the library. ;)
>
> You'll have to teach me how to write the reference material,
> though. That is, I assume it's not hand-written HTML?
Sadly, no. One day we'll use BoostBook generation, but 'till then,
you just copy one of the templates
(e.g. http://www.boost.org/libs/python/doc/v2/header.html) and go
from there.
>
> For the tests I can just use
>
> void test() { ... }
>
> int main()
> {
> if (python::handle_exception(test))
> {
> if (PyErr_Occurred())
> PyErr_Print();
> return 1;
> }
> return 0;
> }
> #include "module_tail.cpp"
>
> as in embedding.cpp right?
Seems likely, but I'm not certain what you need to do for the tests
you want to run.
> That shouldn't be too hard.
>
>
> I'd like to stress again though, that my current solution is pretty
> basic. I really have no use for multiple interpreters
Most people don't, it turns out.
> , or multiple Python-using threads at the moment. If anyone else
> does, and wants to see it addressed in Boost.Python, I encourage
> them to post their code and extra testcases here.
That's the spirit!
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
More information about the Cplusplus-sig
mailing list