[C++-sig] Re: boost::python docstrings

Daniel Holth dholth at fastmail.fm
Mon Jul 14 06:21:33 CEST 2003


On Sun, 2003-07-13 at 16:17, David Abrahams wrote:
> a(b,c):
> foo?
> There's so much information missing I doubt anyone is going to
> understand your question.

Whoops, sorry.  Second try:

I'm working on a Python extension that controls xmms.  It's written in
pure C++ and boost::python.  This is an excerpt from 'pydoc xmms':

Python Library Documentation: module xmms

NAME
    xmms

...

  |  get_playlist_file(...)
  |      Return the filename of a playlist item.
  |  
  |  get_playlist_time(...)
  |      Return length (milliseconds) of a playlist item
  |  
  |  get_playlist_title(...)
  |      Return the title of a playlist item.

...

This is an excerpt from 'pydoc urllib':
  |  get_user_passwd(self, host, realm, clear_cache=0) 
  |
  |  http_error_301(self, url, fp, errcode, errmsg, headers, data=None)
  |      Error 301 -- also relocated (permanently).


Notice how the Python module (urllib) has its argument list in the pydoc
documentation like so: get_user_passwd(self, host, realm,
clear_cache=0), while the boost::python module (or __builtins__, for
that matter) is presented as functionname(...).

My question:  Is there an argument to .def() that will tell pydoc what
to put in place of the ... in e.g. get_playlist_file(...).

The alternative, taken by __builtins__, is to phrase the docstring as
methodcall(example) -> result

Second Question
---------------
I'm also writing an xmms plugin, under the latest Debian Linux, i386,
that runs Python code but I get errors about internal Python symbols not
being found when I try to import other Python modules (like time).  Can
someone point me to an existing project that includes a dynamically
loaded Python embedding?

Thanks,

Daniel Holth
http://dingoskidneys.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030714/a9e0c747/attachment.pgp>


More information about the Cplusplus-sig mailing list