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

Method repeat

src/objects/sequence.rs:59–66  ·  view source on GitHub ↗
(&self, py: Python, count: isize)

Source from the content-addressed store, hash-verified

57 /// NB: Python accepts negative counts; it returns an empty Sequence.
58 #[inline]
59 pub fn repeat(&self, py: Python, count: isize) -> PyResult<PyObject> {
60 unsafe {
61 err::result_from_owned_ptr(
62 py,
63 ffi::PySequence_Repeat(self.as_ptr(), count as Py_ssize_t),
64 )
65 }
66 }
67
68 /// Return the concatenation of o1 and o2 on success. Equivalent to python `o1 += o2`
69 #[inline]

Callers 1

test_seq_repeatFunction · 0.80

Calls 2

result_from_owned_ptrFunction · 0.85
as_ptrMethod · 0.45

Tested by 1

test_seq_repeatFunction · 0.64