Merge pull request #321 from HomerMcMillan/tuple_comparisons

Fix error messages in tuple/list comparisons
This commit is contained in:
Adam
2019-02-05 15:54:54 +00:00
committed by GitHub
2 changed files with 6 additions and 6 deletions

View File

@@ -109,7 +109,7 @@ fn list_gt(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
seq_gt(vm, &zelf, &other)?
} else {
return Err(vm.new_type_error(format!(
"Cannot compare {} and {} using '<'",
"Cannot compare {} and {} using '>'",
zelf.borrow(),
other.borrow()
)));
@@ -131,7 +131,7 @@ fn list_ge(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
seq_ge(vm, &zelf, &other)?
} else {
return Err(vm.new_type_error(format!(
"Cannot compare {} and {} using '<'",
"Cannot compare {} and {} using '>='",
zelf.borrow(),
other.borrow()
)));
@@ -153,7 +153,7 @@ fn list_le(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
seq_le(vm, &zelf, &other)?
} else {
return Err(vm.new_type_error(format!(
"Cannot compare {} and {} using '<'",
"Cannot compare {} and {} using '<='",
zelf.borrow(),
other.borrow()
)));

View File

@@ -47,7 +47,7 @@ fn tuple_gt(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
seq_gt(vm, &zelf, &other)?
} else {
return Err(vm.new_type_error(format!(
"Cannot compare {} and {} using '<'",
"Cannot compare {} and {} using '>'",
zelf.borrow(),
other.borrow()
)));
@@ -69,7 +69,7 @@ fn tuple_ge(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
seq_ge(vm, &zelf, &other)?
} else {
return Err(vm.new_type_error(format!(
"Cannot compare {} and {} using '<'",
"Cannot compare {} and {} using '>='",
zelf.borrow(),
other.borrow()
)));
@@ -91,7 +91,7 @@ fn tuple_le(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
seq_le(vm, &zelf, &other)?
} else {
return Err(vm.new_type_error(format!(
"Cannot compare {} and {} using '<'",
"Cannot compare {} and {} using '<='",
zelf.borrow(),
other.borrow()
)));