[PyQt] More pythonic API

Florian Friesdorf flo at chaoflow.net
Sat Aug 1 10:55:59 BST 2009


On Sat, Aug 01, 2009 at 10:51:27AM +0100, Phil Thompson wrote:
> On Sat, 1 Aug 2009 11:46:59 +0200, Florian Friesdorf <flo at chaoflow.net>
> wrote:
> >> > a = QAction()
> >> > a.setEnabled(True)
> >> > enabled = a.isEnabled()
> >> > (..)
> >> > 
> >> > Preferably these would look something like:
> >> > 
> >> > a = QAction()
> >> > a.enabled = True
> >> > enabled = a.enabled
> >> 
> >> This is fairly easy to implement but would be an incompatible change.
> > 
> > I wouldn't like having my code rely on a specially built PyQt. Is it
> > possible to generate these bindings as extra add-on modules?
> 
> They'd have to be replacements not add ons.

Only, iff there is a collision between those APIs, or?
In the above example, at least, it should work to have them both,
eventually using nasty monkey-patching.

> > I'd like to take a look on it. Can you give me some pointers?
> 
> Read the SIP documentation. You'd be implementing __getitem__ etc with
> %MethodCode.

thx

florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090801/70b03dfe/attachment.bin


More information about the PyQt mailing list