| 2041 | ################################################################################ |
| 2042 | |
| 2043 | class CounterSubclassWithSetItem(Counter): |
| 2044 | # Test a counter subclass that overrides __setitem__ |
| 2045 | def __init__(self, *args, **kwds): |
| 2046 | self.called = False |
| 2047 | Counter.__init__(self, *args, **kwds) |
| 2048 | def __setitem__(self, key, value): |
| 2049 | self.called = True |
| 2050 | Counter.__setitem__(self, key, value) |
| 2051 | |
| 2052 | class CounterSubclassWithGet(Counter): |
| 2053 | # Test a counter subclass that overrides get() |
no outgoing calls