[PyKDE] Any tools to generate sip files?

Jim Bublitz jbublitz at nwinternet.com
Fri Mar 14 05:05:01 GMT 2003


On 14-Mar-03 Frederick Polgardy Jr wrote:
> Well that's essentially what SIP is, although it's more than just
> cpp->pyqt/kde, it's cpp->python in general.

I took him to mean he wanted to translate (line for line) C++ into
python, for example:

if (something)
{
   x = 1
   y = 2
}

to

if something:
    x = 1
    y = 2

which is not what sip does. Sip provides an interface to C++ libs
on the binary level - it has no idea what's in the cpp code, but
only knows what the call/return interface to the code is (hence sip
only needs to look at the h files, not the cpp files - mostly). The
bindings sip produces are in C++, not Python.
 
> Along the same lines, has anybody checked out Boost.Python by any
> chance?  It's pretty awesome.  The folks at Boost are insane.
 
> http://www.boost.org/libs/python/doc/index.html

I've looked at it (and argued with David Abrams on comp.lang.python
a little) but never tried it. Boost has some advantages over sip,
especially if you only want to bind a few functions, have a lot of
templates, or like writing C++. The drawbacks (in the context of
of a large project like PyKDE anyway) is that it requires a lot of
handwritten code, more knowledge of what the code actually does,
looks difficult to automate, and would be difficult to maintain over
a number of versions (right now PyQt supports everything from Qt1.42
onward, and PyKDE supports KDE 2.1.1 onward, each with a single
file set). Can't say as far as performance, but it seems like Boost
should be pretty fast and perhaps a little smaller in binary size.


Jim




More information about the PyQt mailing list