Lines Matching refs:element
14 record multiple occurrences and don't remember the order of element
33 really add a Set as an element to another Set; if you try, what is
157 # to this same set. A set can't be an element of itself, but
274 def __contains__(self, element):
275 """Report whether an element is a member of a set.
277 (Called in response to the expression `element in self'.)
280 return element in self._data
282 transform = getattr(element, "__as_temporarily_immutable__", None)
358 for element in it:
359 data[element] = value
362 transform = getattr(element, "__as_immutable__", None)
368 for element in iterable:
370 data[element] = value
372 transform = getattr(element, "__as_immutable__", None)
497 # Single-element mutations: add, remove, discard
499 def add(self, element):
500 """Add an element to a set.
502 This has no effect if the element is already present.
505 self._data[element] = True
507 transform = getattr(element, "__as_immutable__", None)
512 def remove(self, element):
513 """Remove an element from a set; it must be a member.
515 If the element is not a member, raise a KeyError.
518 del self._data[element]
520 transform = getattr(element, "__as_temporarily_immutable__", None)
525 def discard(self, element):
526 """Remove an element from a set if it is a member.
528 If the element is not a member, do nothing.
531 self.remove(element)
536 """Remove and return an arbitrary set element."""