MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / clear

Method clear

src/objects/set.rs:55–57  ·  view source on GitHub ↗
(&self, py: Python)

Source from the content-addressed store, hash-verified

53 /// Empty an existing set of all values.
54 #[inline]
55 pub fn clear(&self, py: Python) -> PyResult<()> {
56 unsafe { err::error_on_minusone(py, ffi::PySet_Clear(self.0.as_ptr())) }
57 }
58
59 /// Return the number of items in the set
60 /// This is equivalent to Python `len(self)`

Callers 4

test_clearFunction · 0.45

Calls 2

error_on_minusoneFunction · 0.85
as_ptrMethod · 0.45

Tested by 4

test_clearFunction · 0.36