79146876

Date: 2024-11-01 03:48:39
Score: 1
Natty:
Report link

In this case the solution is to use Anonymous union literals.

const py = @cImport({
    @cInclude("Python.h");
});

var pyObject = py.PyObject{
    .unnamed_0 = .{ .ob_refcnt = 1 },
    .ob_type = null,
};

// main fn and stuff..

If the type was a struct, an Anonymous struct literal could be used instead.

Reasons:
  • Whitelisted phrase (-1): solution is
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Matías Santurio