MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / str_list

Function str_list

std/re/src/lib.rs:86–93  ·  view source on GitHub ↗

Builds a Python list handle from string items. */

(items: &[String])

Source from the content-addressed store, hash-verified

84
85 /* Builds a Python list handle from string items. */
86 fn str_list(items: &[String]) -> Result<Handle> {
87 let list = Handle::new_list()?;
88 for s in items {
89 let h = encode(Value::Bytes(s.clone().into_bytes()))?;
90 list.call("append", &[h.raw()])?;
91 }
92 Ok(list)
93 }
94
95 /* search: leftmost match anywhere, returns group 0 or None. */
96 #[plugin_fn]

Callers 1

findallFunction · 0.85

Calls 4

BytesClass · 0.85
encodeFunction · 0.50
callMethod · 0.45
rawMethod · 0.45

Tested by

no test coverage detected