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

Method result

crates/stdlib/src/csv.rs:701–720  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

699 }
700
701 fn result(&self, vm: &VirtualMachine) -> PyResult<PyDialect> {
702 match &self.dialect {
703 DialectItem::Str(name) => {
704 let g = GLOBAL_HASHMAP.lock();
705 if let Some(dialect) = g.get(name) {
706 Ok(self.update_py_dialect(*dialect))
707 } else {
708 Err(new_csv_error(vm, format!("{name} is not registered.")))
709 }
710 // TODO
711 // Maybe need to update the obj from HashMap
712 }
713 DialectItem::Obj(o) => Ok(self.update_py_dialect(*o)),
714 DialectItem::None => {
715 let g = GLOBAL_HASHMAP.lock();
716 let res = *g.get("excel").unwrap();
717 Ok(self.update_py_dialect(res))
718 }
719 }
720 }
721 fn get_skipinitialspace(&self) -> bool {
722 let mut skipinitialspace = match &self.dialect {
723 DialectItem::Str(name) => {

Callers 3

register_dialectFunction · 0.45
readerFunction · 0.45
writerFunction · 0.45

Calls 6

new_csv_errorFunction · 0.85
update_py_dialectMethod · 0.80
ErrClass · 0.50
lockMethod · 0.45
getMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected