Skip to content

Commit 821f3e7

Browse files
committed
fix position value to struct value
1 parent ab284c8 commit 821f3e7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

stdlib/src/array.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,9 +1290,13 @@ mod array {
12901290
impl PyArrayIterator {
12911291
#[pymethod(magic)]
12921292
fn reduce(&self, vm: &VirtualMachine) -> PyTupleRef {
1293-
self.internal
1293+
let tuple = self.internal
12941294
.lock()
1295-
.builtins_iter_reduce(|x| x.clone().into(), vm)
1295+
.builtins_iter_reduce(|x| x.clone().into(), vm);
1296+
let func = tuple[0].clone();
1297+
let obj = tuple[1].clone();
1298+
let pos = self.position.load(atomic::Ordering::SeqCst);
1299+
vm.new_tuple((func, obj, pos,))
12961300
}
12971301
}
12981302

0 commit comments

Comments
 (0)