I don't think your code was particularly wrong, but my version required
fewer handlers to be called when a button is toggled, so I prefer it.

The signal/slot mechanism may be nice in C++, but in Python it very much
fails to take advantage of the facilities of the language, and it
typically seems to take rather more code to do certain kinds of
equivalent work in PyQt than in PyGTK. Specifically, it makes it very
hard to use Python closures. The reference-counting breakage was that
for no apparent reason PyQt doesn't keep a reference to a locally-scoped
function connected to a signal; once the definition of the function goes
out of scope it never gets called, but keeping a reference to it in that
bizarre autopartition_handlers dictionary works around this.

I'm sure Qt is fine in its native C++ environment, but PyGTK's signal
mechanism is really just a lot more Pythonic and easier to deal with
within that language. Anyway ...

-- 
prepare disk space contains "usertrap"
https://launchpad.net/bugs/85980

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to