Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(py): Add more method to tuple object #699

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }
Loading