Function
list_dialects
(
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
Tested by
no test coverage detected