[PyQt] Incompatible Sip module version crashes Python

2011-09-26 Thread Jim Crowell
Over the last few months I've been upgrading a number of applications from bindings created with SIP 4.7.3 to 4.12.2. I notice that if I run such an app using the new bindings and it finds the old SIP api module (sip.pyd on Windows), Python crashes. I've added a bit of code to the Python wrapper

Re: [PyQt] SIP method args default ownership rules

2011-05-05 Thread Jim Crowell
On Wed, 04 May 2011 19:54 +0100, "Phil Thompson" wrote: > On Wed, 04 May 2011 12:47:39 -0500, "Jim Crowell" > wrote: > > > > What are the default assumptions about the ownership of objects passed > > into or returned from SIP-generated methods

[PyQt] SIP method args default ownership rules

2011-05-04 Thread Jim Crowell
Sorry, I used to know this but it's been a little while since I've done any SIPping & the docs on ownership are actually not explicit on this point. What are the default assumptions about the ownership of objects passed into or returned from SIP-generated methods? __

[PyQt] Error compiling siplib.c 4.8.1, visual c++ 7 (.net), python 2.4.4

2009-07-09 Thread Jim Crowell
The initializers for the PyNumberMethods on line 6940 of siplib.c: /* The number methods data structure. */ static PyNumberMethods sipVoidPtr_NumberMethods = { ...contains an item that isn't present in c:\python24\include\object.h: 0 /* nb_index */ ...which causes vis

[PyQt] SIP bug? (typemaps, %Import)

2008-12-09 Thread Jim Crowell
Hi all, This is a bit odd as it's an application that appeared after a change in my .sip code, but it looks like a SIP bug. I get the same behavior with 4.7.3 and 4.7.9. Briefly: I have two modules, szg and szgexpt. szg is much the larger. szgexpt.sip begins with a %Import szg.sip ...and defin

[PyQt] Re: More recent g++ slows build time immensely

2008-10-27 Thread Jim Crowell
Downgrading gcc and g++ from 4.2 to 4.1 decreased build time from about 15 minutes to 13.6 seconds. Thanks all, -Jim C. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] More recent g++ slows build time immensely

2008-10-20 Thread Jim Crowell
Thanks, Giovanni. -Jim C. On Mon, 20 Oct 2008 17:53:01 +0200, "Giovanni Bajo" <[EMAIL PROTECTED]> said: > On 10/20/2008 5:48 PM, Jim Crowell wrote: > > > > However, I'm trying to upgrade to Ubuntu 8.04, which includes g++ 4.2.3. > > Building the bin

[PyQt] More recent g++ slows build time immensely

2008-10-20 Thread Jim Crowell
Hi all, I've been using SIP to generate bindings for Syzygy . Since we've been using GNU Make for everything, I've been running SIP with "-j 1" to generate a single .cpp file, which up til now has worked fine (with MinGW g++ 3.4.2 on Windows and whatever g++ co

Re: [PyQt] SIP: passing exceptions Python -> C++

2008-04-29 Thread Jim Crowell
> From: Phil Thompson <[EMAIL PROTECTED]> > Subject: Re: [PyQt] SIP: passing exceptions Python -> C++ > > > I've got a C++ class with a whole bunch of virtual methods that are > > overridden in Python subclasses. > > > > These methods are callbacks, i.e. they're called repeatedly from a C++ > > eve

[PyQt] SIP: passing exceptions Python -> C++

2008-04-28 Thread Jim Crowell
I've got a C++ class with a whole bunch of virtual methods that are overridden in Python subclasses. These methods are callbacks, i.e. they're called repeatedly from a C++ event loop. I want to catch any Python exceptions raised in any of these callbacks, print the error messages, and then raise

[PyQt] Re: Re: SIP newcomer questions/complaints

2008-04-07 Thread Jim Crowell
> 6) The docs show show no comparisons with similar tools. I'm trying SIP to see > if the memory usage of a large wxPython app can be reduced--I have seen > comparisons claiming that SIP would be slower than hand generated code, but > faster than SWIG. This seems to be a fair assumption, since SWI

[PyQt] Re: SIP newcomer questions/complaints

2008-04-07 Thread Jim Crowell
On Mon, 7 Apr 2008 12:00:08 +0100, [EMAIL PROTECTED] said: > > 3) I ended up using the distutils support--which worked great out of the > box. > But now my scripts are generating enough time to make the compile-link > time > cycle significant. My SIP files use one root file that %Includes all of

[PyQt] Re: SIP feature request (__rmul__)

2008-02-04 Thread Jim Crowell
> I've had second thoughts about this. The reflected methods don't have > C++ > equivalents so it's not obvious what they should do - and you don't need > them > anyway. > > I don't know if Float is a real class, or you mean the C++ float or > double. > I'll assume the latter. > > I assume t

Re: [PyQt] Almost done with the switch to SIP

2008-02-01 Thread Jim Crowell
> From: Phil Thompson <[EMAIL PROTECTED]> > Subject: Re: [PyQt] Almost done with the switch to SIP > To: pyqt@riverbankcomputing.com > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859-1" > > On Thursday 31 January 2008, J

[PyQt] Almost done with the switch to SIP

2008-01-31 Thread Jim Crowell
I'm about 80% through converting the Python bindings for Syzygy (cross-platform, PC-cluster VR, www.isl.uiuc.edu/syzygy.htm) from SWIG to SIP. The source is about 40% smaller, much more readable, and framerates are noticeably higher. SIP rules. -Jim C. ___

[PyQt] SIP feature request (__rmul__)

2008-01-31 Thread Jim Crowell
With __rmul__ not being in the list of supported special methods, is there any way I can implement Float*MyVectorClassInstance? If not, any chance of getting __rmul__ added? Thanks much, -Jim C. ___ PyQt mailing listPyQt@riverbankcomputing.com http:

[PyQt] SIP problem -- multiple /Out/ args?

2008-01-17 Thread Jim Crowell
I'm using SIP 4.7.3. The following method specification in my .sip file: int receiveMessage(string* userName /Out/, string* messageType /Out/, string* messageBody /Out/, string* context /Out/) /ReleaseGIL/ ; Yields the following in the generated cod

[PyQt] Re: SIP newbie question (%MethodCode oddity)

2008-01-14 Thread Jim Crowell
On Thu, 10 Jan 2008 18:00:36 GMT, [EMAIL PROTECTED] said: > > On Tuesday 08 January 2008, Jim Crowell wrote: > > > > float __float__(); > > %MethodCode > > sipRes = (double)sipCpp->numerator() / sipCpp->denominator(); > > %End > > &

[PyQt] SIP newbie question (%MethodCode oddity)

2008-01-08 Thread Jim Crowell
Hi all, I'm fiddling with SIP 4.7.3 on XP for a non-Qt-related project. As a learning exercise I tried porting the Fraction example at to SIP 4. Got it working to a first approximation, but there's a bit that puzzles me: sipCpp doesn't always get defi