[PyKDE] Re: Problem with QStringList in PyQt4

Phil Thompson phil at riverbankcomputing.co.uk
Tue Dec 13 09:17:02 GMT 2005


On Tuesday 13 December 2005 1:00 am, Baz Walter wrote:
> I get an error when calling QStringList.count with no arguments:
> >>> from PyQt4 import QtCore
> >>> s = QtCore.QStringList()
> >>> len(s << 'a' << 'b' << 'b' << 'c')
>
> 4
>
> >>> s.count('b')
>
> 2
>
> >>> s.count()
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: insufficient number of arguments to QStringList.count()
>
>
> Can this be fixed so s.count() returns the equivalent of len(s)?

Yes, it's just a missing overload. All other behaviour above is correct.

Phil




More information about the PyQt mailing list