Stackless Python and PyQt

1.6k views Asked by At

What experiences do you have with Stackless Python and PyQt?

Issues i would be happy if people address:

  1. Compilation of PyQt for Stackless: does PyQt need to be compiled especially for Stackless? is the compilation smooth? problems with bindings etc.

  2. Stability: any unexpected crashes, freezes, pauses and other weirdities?

  3. Memory Management: any hints of memory leaks. comparison of RAM needed for a Stackless/Plain Vanilla PyQt applications

  4. Software Engineering Empowerment: very short outline of flow-of-control models for Stackless-powered PyQt applications

  5. Lessons learned: any painful lesson learned, traps to be avoided, problems to tackle you might have experienced

Be Happy

2

There are 2 answers

0
Brett Stottlemyer On BEST ANSWER

I tried to go down this path several months ago and decided it was not worth the effort.

I was able to run a binary install of PyQt (on Windows) against a stackless version of Python, but I found that I had to manually go in and change some of the files. I was getting an error message (sorry, I forget what it was), and google search led to a solution from several years ago. Newer code did not include the old fix, so the change was not too difficult and (if I remember correctly) it was in python, so no recompile was necessary.

But that was a deal breaker for me. Qt updates come out regularly, as do updates to PyQt, and I didn't want to be continually fixing the code. Stackless and PyQt are simply not used enough together to be checked out thoroughly. I found the risk of difficult to debug issues pretty high. This is especially true given the author of stackless has moved on to PyPy. Let me apologize in advance - I wish I had the references I found for the author stopping development on stackless python and more detail on the errors I had to fix - I wasn't expecting to regurgitate the details on Stack Overflow.

So I chose to run PyQt on a vanilla Python instead of stackless.

BTW, I also thought that mixing signals/slots with stackless code would be confusing, as they are completely different methods of solving multi-threading problems.

Good luck!

2
orokusaki On

If you're interested in all that because of speed optimization:

You may want to check out Unladen Swallow ( Wikipedia here ). Google (because of YouTube being 100% Python) is working on a JIT compiler for Python that will increase its speed by 5-10x (bringing it much closer to Java speeds than the current virtual machine). The best part is that it will work with all existing Python code which means you don't have to fret with all the problems associated with other Python optimization projects.

I expect that if you're developing a large enough project to warrant the need for optimization at a low level, you'd be OK with developing in normal Python and then changing out of the current VM when Unladen Swallow comes out in production.