Lines Matching defs:set

2 /* set object implementation

22 return; /* caller will expect error to be set anyway */
108 * set: start over.
141 * set: start over.
241 known to be absent from the set. This routine also assumes that
242 the set contains no deleted entries. Besides the performance benefit,
326 /* Make the set empty, using the new table. */
470 /* This is delicate. During the process of clearing the set,
471 * decrefs can cause the set to mutate. To avoid fatal confusion
472 * (voice of experience), we have to make the set empty before
482 * Afraid the only safe way is to copy the set entries into
516 * Iterate over a set table. Use like so:
728 PyErr_SetString(PyExc_KeyError, "pop from an empty set");
732 /* Set entry to "the first" unused or dummy set entry. We abuse
762 PyDoc_STRVAR(pop_doc, "Remove and return an arbitrary set element.\n\
763 Raises KeyError if the set is empty.");
997 "Update a set with the union of itself and others.");
1093 if (type == &PySet_Type && !_PyArg_NoKeywords("set()", kwds))
1103 t=set(a); a.clear(); a.update(b); b.clear(); b.update(t); del t
1166 PyDoc_STRVAR(copy_doc, "Return a shallow copy of a set.");
1175 PyDoc_STRVAR(clear_doc, "Remove all elements from this set.");
1201 "Return the union of sets as a new set.\n\
1203 (i.e. all elements that are in either set.)");
1347 "Return the intersection of two or more sets as a new set.\n\
1378 "Update a set with the intersection of itself and another.");
1525 "Remove all elements of another set from this set.");
1604 "Return the difference of two or more sets as a new set.\n\
1606 (i.e. all elements that are in this set but not the others.)");
1695 "Update a set with the symmetric difference of itself and another.");
1714 "Return the symmetric difference of two sets as a new set.\n\
1773 PyDoc_STRVAR(issubset_doc, "Report whether another set contains this set.");
1791 PyDoc_STRVAR(issuperset_doc, "Report whether this set contains another set.");
1851 "Add an element to a set.\n\
1916 "Remove an element from a set; it must be a member.\n\
1943 "Remove an element from a set if it is a member.\n\
1993 if (PySet_Check(self) && !_PyArg_NoKeywords("set()", kwds))
2015 /* set object ********************************************************/
2110 "set() -> new empty set object\n\
2111 set(iterable) -> new set object\n\
2117 "set", /* tp_name */
2284 PySet_Clear(PyObject *set)
2286 if (!PySet_Check(set)) {
2290 return set_clear_internal((PySetObject *)set);
2304 PySet_Discard(PyObject *set, PyObject *key)
2306 if (!PySet_Check(set)) {
2310 return set_discard_key((PySetObject *)set, key);
2325 _PySet_Next(PyObject *set, Py_ssize_t *pos, PyObject **key)
2329 if (!PyAnySet_Check(set)) {
2333 if (set_next((PySetObject *)set, pos, &entry_ptr) == 0)
2340 _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, long *hash)
2344 if (!PyAnySet_Check(set)) {
2348 if (set_next((PySetObject *)set, pos, &entry) == 0)
2356 PySet_Pop(PyObject *set)
2358 if (!PySet_Check(set)) {
2362 return set_pop((PySetObject *)set);
2366 _PySet_Update(PyObject *set, PyObject *iterable)
2368 if (!PySet_Check(set)) {
2372 return set_update_internal((PySetObject *)set, iterable);
2377 /* Test code to be called with any three element set.
2378 Returns True and original set is restored. */
2402 /* so.clear(); so |= set("abc"); */
2445 /* Raise SystemError on clear or update of frozen set */
2472 /* Raise SystemError when self argument is not a set or frozenset. */
2478 /* Raise SystemError when self argument is not a set. */
2486 /* Raise KeyError when popping from an empty set */
2492 /* Restore the set from the copy using the PyNumber API */