const c = @import("c"); const zpy = @import("root.zig"); pub const StructSequence = extern struct { const Self = @This(); data: c.PyObject, pub fn new(t: *zpy.Type) !*Self { return @ptrCast(c.PyStructSequence_New(@ptrCast(@constCast(t))) orelse return error.Exception); } pub fn get(self: *Self, index: usize) *Self { return @ptrCast(c.PyStructSequence_GetItem(@ptrCast(self), @intCast(index))); } pub fn set(self: *Self, index: usize, value: *zpy.Object) void { c.PyStructSequence_SetItem(@ptrCast(self), @intCast(index), @ptrCast(value)); } pub fn asObject(self: *Self) *zpy.Object { return @ptrCast(self); } };