Skip to content

Commit

Permalink
Merge pull request #699 from aisk/py-tuple
Browse files Browse the repository at this point in the history
feat(py): Add more method to tuple object
  • Loading branch information
xushiwei authored Aug 12, 2024
2 parents 3eedad9 + 4b26dac commit 321766f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion py/tuple.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,22 @@ func NewTuple(len uintptr) *Object
// llgo:link (*Object).TupleLen C.PyTuple_Size
func (t *Object) TupleLen() uintptr { return 0 }

// Return the object at position pos in the tuple pointed to by p. If pos is
// Return the object at position pos in the tuple pointed to t. If pos is
// negative or out of bounds, return nil and set an IndexError exception.
//
// llgo:link (*Object).TupleItem C.PyTuple_GetItem
func (t *Object) TupleItem(index uintptr) *Object { return nil }

// Insert a reference to object o at position pos of the tuple pointed to by t.
// Return 0 on success. If pos is out of bounds, return -1 and set an
// IndexError exception.
//
// llgo:link (*Object).TupleSetItem C.PyTuple_SetItem
func (t *Object) TupleSetItem(index int, o *Object) int { return 0 }

// Return the slice of the tuple pointed to by t between low and high,
// or NULL on failure. This is the equivalent of the Python expression
// p[low:high]. Indexing from the end of the tuple is not supported.
//
// llgo:link (*Object).TupleSlice C.PyTuple_GetSlice
func (l *Object) TupleSlice(low, high int) *Object { return nil }

0 comments on commit 321766f

Please sign in to comment.