How to build the documentation
Pedro Larroy <[email protected]>
| Newsgroups | gmane.comp.lib.boost.documentation |
|---|---|
| Message-ID | <CAC_CU1i648FU-qXRGWct9YK=HpqLH6i_bz4PdGh6FsXO8nHgJw@mail.gmail.com> |
Hi I created a small patch for libs/python/doc/tutorial/doc/tutorial.qbk How can I check that it builds correctly and generates propper html? Regards. Pedro. _______________________________________________ Boost-docs mailing list [email protected] http://lists.boost.org/mailman/listinfo.cgi/boost-docs
bp_tutorial.diff
(text/x-patch, 1012 B)
Index: libs/python/doc/tutorial/doc/tutorial.qbk =================================================================== --- libs/python/doc/tutorial/doc/tutorial.qbk (revision 76153) +++ libs/python/doc/tutorial/doc/tutorial.qbk (working copy) @@ -1302,6 +1302,22 @@ [def PyModule_GetDict [@http://www.python.org/doc/current/api/moduleObjects.html#l2h-594 PyModule_GetDict]] [endsect] + +[section Creating boost::python::object from PyObject*] + +When you want a boost::python::object to manage a pointer to PyObject* pyobj one does: + + boost::python::object o(boost::python::handle<>(pyobj)); + +In this case, the o object, manages the pyobj, it won’t increase the reference count on construction. + +Otherwise, to use a borrowed reference: + + boost::python::object o(boost::python::handle<>(boost::python::borrowed(pyobj))); + +In this case, Py_INCREF is called, so pyobj is not destructed when object o goes out of scope. +[endsect] + [endsect] [/ Object Interface] [section Embedding]