You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 26, 2025. It is now read-only.
Any call to CPython API PySequence_Fast_GET_SIZE will result in this error:
...\.zig-cache\o\6bacacdc44df520a1df153414437fc32\cimport.zig:8950:76: error: expected type 'bool', found 'c_int'
pub inline fn PySequence_Fast_GET_SIZE(o: anytype) @TypeOf(if (PyList_Check(o)) PyList_GET_SIZE(o) else PyTuple_GET_SIZE(o)) {
~~~~~~~~~~~~^~~
pack_py.zig:62:44: note: called from here
const len = py.PySequence_Fast_GET_SIZE(fastseq);
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
Zig Version
0.14.1
Steps to Reproduce and Observed Behavior
Any call to CPython API
PySequence_Fast_GET_SIZEwill result in this error:pyis defined as the following:Expected Behavior
Checking the translated code, I found that the translate-c module convert this C definition:
to
However, the return type of
PyList_Checkis int rather than bool, which caused this problem.Maybe when translating this, the ternary condition should be wrapped with an helper function converting int to bool.