-
Notifications
You must be signed in to change notification settings - Fork 187
Closed
Labels
Description
Because the new pycall!
implementation in #492 uses a global cache of Python tuples, we encounter some sticky problems due to lack of re-entrancy. In particular, if the PyObject
call in pysetarg!
itself calls pycall
with the same number of arguments, we get the wrong results.
This can happen with the range conversions:
julia> f = py"lambda x,y,z: (x,y,z)"
PyObject <function <lambda> at 0x145cba510>
julia> pycall(f, PyObject, 3,4,5)
PyObject (3, 4, 5)
julia> pycall(f, PyObject, 3:6,4:10,5:11) # WRONG RESULT:
PyObject (5, 12, range(5, 12))
cc @JobJob