mirror of
https://github.com/python/cpython.git
synced 2025-09-22 16:33:26 +00:00
Simplify example
This commit is contained in:
parent
d079367044
commit
f9ca76f500
1 changed files with 0 additions and 4 deletions
|
@ -889,10 +889,6 @@ so that the counter remembers the order elements are first encountered::
|
||||||
class OrderedCounter(Counter, OrderedDict):
|
class OrderedCounter(Counter, OrderedDict):
|
||||||
'Counter that remembers the order elements are first encountered'
|
'Counter that remembers the order elements are first encountered'
|
||||||
|
|
||||||
def __init__(self, iterable=None, **kwds):
|
|
||||||
OrderedDict.__init__(self)
|
|
||||||
Counter.__init__(self, iterable, **kwds)
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '%s(%r)' % (self.__class__.__name__, OrderedDict(self))
|
return '%s(%r)' % (self.__class__.__name__, OrderedDict(self))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue