Skip to content

Commit bcf5e8a

Browse files
committed
Repair tuple get elements
1 parent f563856 commit bcf5e8a

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

vm/src/obj/objtuple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fn tuple_str(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
2626
}
2727

2828
pub fn get_elements(obj: &PyObjectRef) -> Vec<PyObjectRef> {
29-
if let PyObjectKind::List { elements } = &obj.borrow().kind {
29+
if let PyObjectKind::Tuple { elements } = &obj.borrow().kind {
3030
elements.to_vec()
3131
} else {
3232
panic!("Cannot extract elements from non-tuple");

vm/src/pyobject.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -785,11 +785,6 @@ impl PartialEq for PyObject {
785785
(PyObjectKind::String { value: ref v1i }, PyObjectKind::String { value: ref v2i }) => {
786786
*v2i == *v1i
787787
}
788-
/*
789-
(&NativeType::Float(ref v1f), &NativeType::Float(ref v2f)) => {
790-
curr_frame.stack.push(Rc::new(NativeType::Boolean(v2f == v1f)));
791-
},
792-
*/
793788
(PyObjectKind::List { elements: ref l1 }, PyObjectKind::List { elements: ref l2 })
794789
| (
795790
PyObjectKind::Tuple { elements: ref l1 },

0 commit comments

Comments
 (0)