MCPcopy Index your code
hub / github.com/RustPython/RustPython / list_dialects

Function list_dialects

crates/stdlib/src/csv.rs:332–347  ·  view source on GitHub ↗
(
        rest: FuncArgs,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

330
331 #[pyfunction]
332 fn list_dialects(
333 rest: FuncArgs,
334 vm: &VirtualMachine,
335 ) -> PyResult<rustpython_vm::builtins::PyListRef> {
336 if !rest.args.is_empty() || !rest.kwargs.is_empty() {
337 return Err(vm.new_type_error("too many argument"));
338 }
339 let g = GLOBAL_HASHMAP.lock();
340 let t = g
341 .keys()
342 .cloned()
343 .map(|x| vm.ctx.new_str(x).into())
344 .collect_vec();
345 // .iter().map(|x| vm.ctx.new_str(x.clone()).into_pyobject(vm)).collect_vec();
346 Ok(vm.ctx.new_list(t))
347 }
348
349 #[pyfunction]
350 fn field_size_limit(rest: FuncArgs, vm: &VirtualMachine) -> PyResult<isize> {

Callers

nothing calls this directly

Calls 7

new_listMethod · 0.80
ErrClass · 0.50
is_emptyMethod · 0.45
lockMethod · 0.45
mapMethod · 0.45
keysMethod · 0.45
new_strMethod · 0.45

Tested by

no test coverage detected