Lines Matching defs:set

2 /* set object implementation
30 advance. Accordingly, the set implementation needs to optimize for both
190 known to be absent from the set. Besides the performance benefit,
281 /* Make the set empty, using the new table. */
409 /* This is delicate. During the process of clearing the set,
410 * decrefs can cause the set to mutate. To avoid fatal confusion
411 * (voice of experience), we have to make the set empty before
420 * Afraid the only safe way is to copy the set entries into
446 * Iterate over a set table. Use like so:
518 /* shortcut for the empty set */
571 /* a.update(a) or a.update(set()); nothing to do */
638 PyErr_SetString(PyExc_KeyError, "pop from an empty set");
654 PyDoc_STRVAR(pop_doc, "Remove and return an arbitrary set element.\n\
655 Raises KeyError if the set is empty.");
943 "Update a set with the union of itself and others.");
947 set object 64 byte aligned so that most of the fields
1051 t=set(a); a.clear(); a.update(b); b.clear(); b.update(t); del t
1109 PyDoc_STRVAR(copy_doc, "Return a shallow copy of a set.");
1118 PyDoc_STRVAR(clear_doc, "Remove all elements from this set.");
1144 "Return the union of sets as a new set.\n\
1146 (i.e. all elements that are in either set.)");
1287 "Return the intersection of two sets as a new set.\n\
1318 "Update a set with the intersection of itself and another.");
1415 /* Optimization: When the other set is more than 8 times
1416 larger than the base set, replace the other set with
1477 "Remove all elements of another set from this set.");
1594 "Return the difference of two or more sets as a new set.\n\
1596 (i.e. all elements that are in this set but not the others.)");
1682 "Update a set with the symmetric difference of itself and another.");
1703 "Return the symmetric difference of two sets as a new set.\n\
1764 PyDoc_STRVAR(issubset_doc, "Report whether another set contains this set.");
1796 PyDoc_STRVAR(issuperset_doc, "Report whether this set contains another set.");
1850 "Add an element to a set.\n\
1915 "Remove an element from a set; it must be a member.\n\
1942 "Remove an element from a set if it is a member.\n\
1944 Unlike set.remove(), the discard() method does not raise\n\
1945 an exception when an element is missing from the set.");
1986 if (!_PyArg_NoKeywords("set", kwds))
2004 if (!_PyArg_NoKwnames("set", kwnames)) {
2009 if (!_PyArg_CheckPositional("set", nargs, 0, 1)) {
2031 /* set object ********************************************************/
2122 "set() -> new empty set object\n\
2123 set(iterable) -> new set object\n\
2129 "set", /* tp_name */
2300 PySet_Clear(PyObject *set)
2302 if (!PySet_Check(set)) {
2306 return set_clear_internal((PySetObject *)set);
2320 PySet_Discard(PyObject *set, PyObject *key)
2322 if (!PySet_Check(set)) {
2326 return set_discard_key((PySetObject *)set, key);
2341 _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash)
2345 if (!PyAnySet_Check(set)) {
2349 if (set_next((PySetObject *)set, pos, &entry) == 0)
2357 PySet_Pop(PyObject *set)
2359 if (!PySet_Check(set)) {
2363 return set_pop((PySetObject *)set, NULL);
2367 _PySet_Update(PyObject *set, PyObject *iterable)
2369 if (!PySet_Check(set)) {
2373 return set_update_internal((PySetObject *)set, iterable);
2381 /* Test code to be called with any three element set.
2382 Returns True and original set is restored. */
2407 /* so.clear(); so |= set("abc"); */
2450 /* Raise SystemError on clear or update of frozen set */
2477 /* Raise SystemError when self argument is not a set or frozenset. */
2483 /* Raise SystemError when self argument is not a set. */
2491 /* Raise KeyError when popping from an empty set */
2497 /* Restore the set from the copy using the PyNumber API */