Skip to content

Commit b63b9fc

Browse files
committed
Mark PyTuple as ThreadSafe
1 parent 2412264 commit b63b9fc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vm/src/obj/objtuple.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::pyhash;
99
use crate::pyobject::{
1010
IntoPyObject,
1111
PyArithmaticValue::{self, *},
12-
PyClassImpl, PyComparisonValue, PyContext, PyObjectRef, PyRef, PyResult, PyValue,
12+
PyClassImpl, PyComparisonValue, PyContext, PyObjectRef, PyRef, PyResult, PyValue, ThreadSafe,
1313
};
1414
use crate::sequence::{self, SimpleSeq};
1515
use crate::vm::{ReprGuard, VirtualMachine};
@@ -23,6 +23,8 @@ pub struct PyTuple {
2323
elements: Vec<PyObjectRef>,
2424
}
2525

26+
impl ThreadSafe for PyTuple {}
27+
2628
impl fmt::Debug for PyTuple {
2729
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2830
// TODO: implement more informational, non-recursive Debug formatter
@@ -247,6 +249,8 @@ pub struct PyTupleIterator {
247249
tuple: PyTupleRef,
248250
}
249251

252+
impl ThreadSafe for PyTupleIterator {}
253+
250254
impl PyValue for PyTupleIterator {
251255
fn class(vm: &VirtualMachine) -> PyClassRef {
252256
vm.ctx.tupleiterator_type()

0 commit comments

Comments
 (0)