lxml.html._setmixin module
- class lxml.html._setmixin.SetMixin[source]
Bases:
MutableSet
Mix-in for sets. You must define __iter__, add, remove
- classmethod _from_iterable(it)[source]
Construct an instance of the class from any iterable input.
Must override this method if the class constructor signature does not accept an iterable for an input.
- _hash()
Compute the hash value of a set.
Note that we don’t define __hash__: not all sets are hashable. But if you define a hashable set type, its __hash__ should call this function.
This must be compatible __eq__.
All sets ought to compare equal if they contain the same elements, regardless of how they are implemented, and regardless of the order of the elements; so there’s not much freedom for __eq__ or __hash__. We match the algorithm used by the built-in frozenset type.
- abstract add(value)
Add an element.
- clear()
This is slow (creates N new iterators!) but effective.
- difference(other)
- intersection(other)
- isdisjoint(other)
Return True if two sets have a null intersection.
- issubset(other)
Return self<=value.
- issuperset(other)
Return self>=value.
- pop()
Return the popped value. Raise KeyError if empty.
- remove(value)
Remove an element. If not a member, raise a KeyError.
- symmetric_difference(other)
- union(other)
Return self|value.
- _abc_impl = <_abc._abc_data object>