Skip to content

Commit c8a6976

Browse files
committed
Make Tuple.Copy()
1 parent 11d5c5d commit c8a6976

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

py/tuple.go

+8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ func (o Tuple) Type() *Type {
1111
return TupleType
1212
}
1313

14+
// Copy a tuple object
15+
func (t Tuple) Copy() Tuple {
16+
newT := make(Tuple, len(t))
17+
for i := range t {
18+
newT[i] = t[i]
19+
}
20+
return newT
21+
}
1422
func (t Tuple) M__len__() Object {
1523
return Int(len(t))
1624
}

0 commit comments

Comments
 (0)