[PyKDE] Problem with QStringList in PyQt4

Baz Walter bazwal at ftml.net
Tue Dec 13 01:00:58 GMT 2005


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)?


Regards
-- 
Baz Walter




More information about the PyQt mailing list