equal
deleted
inserted
replaced
2796 def __init__(self, data=(), datarepr=None): |
2796 def __init__(self, data=(), datarepr=None): |
2797 """ |
2797 """ |
2798 datarepr: a tuple of (format, obj, ...), a function or an object that |
2798 datarepr: a tuple of (format, obj, ...), a function or an object that |
2799 provides a printable representation of the given data. |
2799 provides a printable representation of the given data. |
2800 """ |
2800 """ |
|
2801 self._ascending = None |
2801 if not isinstance(data, list): |
2802 if not isinstance(data, list): |
2802 if isinstance(data, set): |
2803 if isinstance(data, set): |
2803 self._set = data |
2804 self._set = data |
|
2805 # set has no order we pick one for stability purpose |
|
2806 self._ascending = True |
2804 data = list(data) |
2807 data = list(data) |
2805 self._list = data |
2808 self._list = data |
2806 self._datarepr = datarepr |
2809 self._datarepr = datarepr |
2807 self._ascending = None |
|
2808 |
2810 |
2809 @util.propertycache |
2811 @util.propertycache |
2810 def _set(self): |
2812 def _set(self): |
2811 return set(self._list) |
2813 return set(self._list) |
2812 |
2814 |