what is the difference between commenting and uncommenting the __init__ method in this class?
iMath
redstone-cold at 163.com
Mon Jan 28 21:09:23 EST 2013
what is the difference between commenting and uncommenting the __init__ method in this class?
class CounterList(list):
counter = 0
## def __init__(self, *args):
## super(CounterList, self).__init__(*args)
def __getitem__(self, index):
self.__class__.counter += 1
return super(CounterList, self).__getitem__(index)
More information about the Python-list
mailing list