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
Here is an example of how pointers should be manipulated, in Fortran, Python, both should generate the same ASR, and the C backend should then generate the output below:
Note: I think c_loc(x[idx]) will not work in CPython, since x[idx] will return an integer as a value, so we can't take pointer to it from inside c_loc. We'll have to use some syntax from https://docs.python.org/3/library/ctypes.html#pointers.
Activity
certik commentedon Jun 1, 2022
To pass
void *as function arguments, in Python:translates to C:
certik commentedon Jun 1, 2022
Note: I think
c_loc(x[idx])will not work in CPython, sincex[idx]will return an integer as a value, so we can't take pointer to it from insidec_loc. We'll have to use some syntax from https://docs.python.org/3/library/ctypes.html#pointers.czgdp1807 commentedon Jun 7, 2022
In Python, instead of
x = c_p_pointer(queries, i16)can we do,c_p_pointer(queries, x)? @certikcertik commentedon Jun 8, 2022
Yes, that's fine, if it can be done.
certik commentedon Jun 15, 2022
Most of these are fixed. The remaining issue is #609.
ubaidsk commentedon Sep 9, 2023
Can this be done @certik , @czgdp1807 ? Probably not. I think
Pythondoes not allow/support updating a variable passed as argument.certik commentedon Sep 10, 2023
Right, Python does not support it.