1 from copy import deepcopy
2
7
9 values=list(self)
10 values.sort()
11 attributes=', '.join([repr(x) for x in values])
12 return '%s(%r, [%s])' % (
13 self.__class__.__name__,
14 self.key,
15 attributes)
16
18 """
19 Note that LDAPAttributeSets can also be compared against any
20 iterator. In that case the attributeType will be ignored.
21 """
22 if isinstance(other, LDAPAttributeSet):
23 if self.key != other.key:
24 return False
25 return super(LDAPAttributeSet, self).__eq__(other)
26 else:
27 me=list(self)
28 me.sort()
29 him=list(other)
30 him.sort()
31 return me == him
32
34 return not self==other
35
37 return set(self) - set(other)
38
40 return set(self) | set(other)
41
43 return set(self) & set(other)
44
46 return set(self) ^ set(other)
47
49 result = self.__class__(self.key)
50 result.update(self)
51 return result
52 __copy__ = copy
53
55 result = self.__class__(self.key)
56 memo[id(self)] = result
57 data = deepcopy(set(self), memo)
58 result.update(data)
59 return result
60