MCPcopy Create free account
hub / github.com/pybind/pybind11 / set

Class set

include/pybind11/pytypes.h:2337–2350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2335};
2336
2337class set : public anyset {
2338public:
2339 PYBIND11_OBJECT_CVT(set, anyset, PySet_Check, PySet_New)
2340 set() : anyset(PySet_New(nullptr), stolen_t{}) {
2341 if (!m_ptr) {
2342 pybind11_fail("Could not allocate set object!");
2343 }
2344 }
2345 template <typename T>
2346 bool add(T &&val) /* py-non-const */ {
2347 return PySet_Add(m_ptr, detail::object_or_cast(std::forward<T>(val)).ptr()) == 0;
2348 }
2349 void clear() /* py-non-const */ { PySet_Clear(m_ptr); }
2350};
2351
2352class frozenset : public anyset {
2353public:

Callers 7

operator=Function · 0.70
runFunction · 0.50
TEST_SUBMODULEFunction · 0.50
test_setFunction · 0.50
__init__Method · 0.50
test_set_caster_protocolFunction · 0.50

Calls

no outgoing calls

Tested by 5

TEST_SUBMODULEFunction · 0.40
test_setFunction · 0.40
__init__Method · 0.40
test_set_caster_protocolFunction · 0.40