Skip to content

Commit 0e40c5c

Browse files
committed
update input python
1 parent d52d85b commit 0e40c5c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/input/input_python.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,17 @@ fn get_ordered_dict_type(py: Python<'_>) -> &Bound<'_, PyType> {
6363
}
6464

6565
fn check_if_ordered_dict(obj: &Bound<'_, PyAny>) -> bool {
66-
println!("check_if_ordered_dict: {:?}", obj);
6766
if obj.is_exact_instance_of::<PyDict>() {
68-
println!("is exact dict");
6967
return false;
7068
}
7169

7270
if let Ok(type_name) = obj.get_type().name() {
73-
println!("this is the type name: {}", type_name);
7471
if type_name.to_string() != "OrderedDict" {
7572
return false;
7673
}
7774
}
7875

7976
let ordered_dict_type = get_ordered_dict_type(obj.py());
80-
println!("is ordered dict type: {}", ordered_dict_type);
8177
obj.is_instance(ordered_dict_type).unwrap_or(false)
8278
}
8379

@@ -432,14 +428,13 @@ impl<'py> Input<'py> for Bound<'py, PyAny> {
432428
Ok(GenericPyMapping::Dict(self.downcast::<PyDict>()?))
433429
} else if check_if_ordered_dict(self) {
434430
Ok(GenericPyMapping::Mapping(self.downcast::<PyMapping>()?))
435-
}
436-
else {
431+
} else {
437432
Err(ValError::new(ErrorTypeDefaults::DictType, self))
438433
}
439434
}
440435

441436
fn lax_dict<'a>(&'a self) -> ValResult<GenericPyMapping<'a, 'py>> {
442-
if (self.is_instance_of::<PyDict>() || self.is_instance_of::<PyMapping>()) {
437+
if self.is_instance_of::<PyDict>() || self.is_instance_of::<PyMapping>() {
443438
Ok(GenericPyMapping::Mapping(self.downcast::<PyMapping>()?))
444439
} else {
445440
Err(ValError::new(ErrorTypeDefaults::DictType, self))

0 commit comments

Comments
 (0)