usse/funda-scraper/venv/lib/python3.10/site-packages/mypyc/lib-rt/set_ops.c

18 lines
351 B
C
Raw Normal View History

2023-02-20 22:38:24 +00:00
// Set primitive operations
//
// These are registered in mypyc.primitives.set_ops.
#include <Python.h>
#include "CPy.h"
bool CPySet_Remove(PyObject *set, PyObject *key) {
int success = PySet_Discard(set, key);
if (success == 1) {
return true;
}
if (success == 0) {
_PyErr_SetKeyError(key);
}
return false;
}