[Python-de] count() mit eigenem Listentyp
Andreas Pakulat
apaku at gmx.de
Die Jan 3 01:27:50 CET 2006
Hi,
hab hier ein Problem beim Aufruf von count() auf einem von "list"
abgeleiteten Listen-Typ.
class MyList(list):
def __init__(self):
list.__init__(self)
l = MyList()
print l.count()
liefert einen TypeError:
Traceback (most recent call last):
File "testlist.py", line 7, in ?
print l.count()
TypeError: count() takes exactly one argument (0 given)
l.count(l) dagegen funktioniert.
Was mache ich denn da falsch?
Andreas
--
Your boss climbed the corporate ladder, wrong by wrong.