const c = @import("c"); const zpy = @import("root.zig"); pub const Float = extern struct { const Self = @This(); object: c.PyObject, pub fn from(value: f64) !*Self { return @ptrCast(c.PyFloat_FromDouble(value) orelse return error.Exception); } pub fn asDouble(self: *const Self) f64 { return c.PyFloat_asDouble(self.object.ptr); } pub fn deinit(self: *Self) void { self.object.decref(); } pub fn asObject(self: *Self) *zpy.Object { return @ptrCast(self); } };