def __eq__(self, other):
return tuple(sorted(self.iter())) == tuple(sorted(other.iter()))
+ def issubset(self, other):
+ return self <= other
+
+ def issuperset(self, other):
+ return self >= other
+
+ def union(self, other):
+ return self | other
+
+ def intersection(self, other):
+ return self & other
+
+ def difference(self, other):
+ return self - other
+
+ def symmetric_difference(self, other):
+ return self ^ other
+
+ def copy(self):
+ return set(self)
+
def __hash__(self):
return hash(tuple(self.iter()))
"""
# Since we subclass ImmutableTagSet we inherit a __hash__. But we
- # are mutable, setting it to None will make the Python machinary
+ # are mutable, setting it to None will make the Python machinery
# recognise us as unhashable.
__hash__ = None
:raises TypeError: If the tag is not a valid type.
:raises TagTooLongError: If the added tag exceeds the maximum
- lenght, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
+ length, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
:raises ReadOnlyDatabaseError: If the database is opened in
read-only mode.
"""
:raises TypeError: If the tag is not a valid type.
:raises TagTooLongError: If the tag exceeds the maximum
- lenght, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
+ length, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
:raises ReadOnlyDatabaseError: If the database is opened in
read-only mode.
"""
class TagsIter(base.NotmuchObject, collections.abc.Iterator):
"""Iterator over tags.
- This is only an interator, not a container so calling
+ This is only an iterator, not a container so calling
:meth:`__iter__` does not return a new, replenished iterator but
only itself.