[PyKDE] None as a string argument

Giovanni Bajo rasky at develer.com
Wed Sep 21 01:06:42 BST 2005


Anthony Heading <aheading at jpmorgan.com> wrote:

> The latest pyqt (3.15) with sip 4.3.1 seems to disallow None to be
> passed
> into any Qt function expecting a QString.  For example, adding a line
> to tut1.py:
>     button.setText(None)
> produced a blank button in earlier pyqt releases, but now gives an
>     error: Runtime Error: cannot pass None as argument 0 in this call


Yes. Allowing None as a QString breaks the idea that None almost maps 1:1 to
NULL in C++. Also it has the nasty side-effects of not allowing to disambiguate
overloads in some cases
(http://mats.imk.fraunhofer.de/pipermail/pykde/2005-April/010108.html).

Giovanni Bajo




More information about the PyQt mailing list