[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] QString in PyQt4 - Request for Comments
From:       Doug Bell <dougb () bellz ! org>
Date:       2005-10-21 10:43:06
Message-ID: 20051021104306.GA10036 () bellz ! org
[Download RAW message or body]

Giovanni Bajo wrote:

> Phil Thompson <phil@riverbankcomputing.co.uk> wrote:
>
> > I'm completely open to making the existing API more Pythonic - this is the
> > time to do it. For example, I did casually float the idea of not using C++
> > types in signal signatures in a previous post - but nobody bit.
> 
> I didn't, because of the reasons explained previously: I believe it would
> just cause more confusion, in the current PyQt design. It's just too handy
> to go looking to the signature in the Qt Assistant and use it. I don't want
> to go check in two different manuals. Until now, PyQt's goal has been to
> adhere as much as possible to Qt, to not confuse existing Qt users and I
> think it's a noble goal. I also understand that this is not ideal for a
> Python-only programmer.

I disagree with Giovanni.  I signal signatures could be made somewhat
more pythonic without the adverse impact.  For example, it could remove
the C++ constant, pointer and reference indicators ("const", "*" and
"&") that Python-only programmers don't really understand.  As long as
the change was consistent, you would not need to use a second manual.
And it would make it easier to remember some signatures without referring
to a manual or wondering whether the parameter was a constant, pointer
or reference.

Regarding the more general questions, I also think that things should be
made a bit more pythonic without deviating much from the Qt API.
Python unicode strings should be returned in place of QString, maybe
with a way of using a switch to get the QString if desired.  And I think
that Python containers should be used in place of Qt's template
containers.

Doug.

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic