Implement TruncatableSet.__repr__.

This commit is contained in:
Valentin Lorentz 2014-07-31 22:52:44 +02:00
parent 5f582e3f52
commit 00e25f86d8

View File

@ -460,6 +460,8 @@ class TruncatableSet(collections.MutableSet):
def __init__(self, iterable=[]): def __init__(self, iterable=[]):
self._ordered_items = list(iterable) self._ordered_items = list(iterable)
self._items = set(self._ordered_items) self._items = set(self._ordered_items)
def __repr__(self):
return 'TruncatableSet({%r})' % self._items
def __contains__(self, item): def __contains__(self, item):
return item in self._items return item in self._items
def __iter__(self): def __iter__(self):