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
Just jotting down some thoughts on how to get PythonCall to v1. There are a bunch of API changes I want to make and other large changes to the code.
Internally refactor the code into more modules, PythonCall_X where X is CPython, Base (Py and related functionality), PyList, PySet, ..., JuliaValue (pyjl), PyMacro (@py), Convert (pyconvert), MultiMedia, JuliaCall, etc. This will make it easier to reason about the package in smaller chunks and make the dependencies between various parts more explicit. In the future these could be split off into separate packages.
Maybe change how PyArray is parameterised.
Change pyconvert to use a simpler explicit branching logic (branching on the target type and the python type).
Maybe change pyconvert to prefer copying conversion over wrapping.
Change pyconvert to take keyword arguments to more finely control the conversion. For example copy=true to force copying conversion.
Configure with Preferences.jl.
Rewrite @py, splitting branches out into separate functions and removing MacroTools.
Add pydel!_of_Py_is_safe(x) returning true if pydel!(Py(x)) is safe. Use this to automatically pydel! stuff where possible, e.g. in @py.
Put unsafe_ prefix on unsafe functions like pydel! and pynew() and/or remove them from the API. Recommend using @pyconst instead.
Check for threadid() == 1 in finalisers.
Make all values in JuliaCall be of the same JuliaValue type (or Jl?), just as all Python values in PythonCall are of the same Py type. Implement wrappers on top of this.
Add a constructor JuliaValue(x).
The text was updated successfully, but these errors were encountered:
Just jotting down some thoughts on how to get PythonCall to v1. There are a bunch of API changes I want to make and other large changes to the code.
PythonCall_X
where X is CPython, Base (Py
and related functionality), PyList, PySet, ..., JuliaValue (pyjl
), PyMacro (@py
), Convert (pyconvert
), MultiMedia, JuliaCall, etc. This will make it easier to reason about the package in smaller chunks and make the dependencies between various parts more explicit. In the future these could be split off into separate packages.PyArray
is parameterised.pyconvert
to use a simpler explicit branching logic (branching on the target type and the python type).pyconvert
to prefer copying conversion over wrapping.pyconvert
to take keyword arguments to more finely control the conversion. For examplecopy=true
to force copying conversion.@py
, splitting branches out into separate functions and removing MacroTools.pydel!_of_Py_is_safe(x)
returning true ifpydel!(Py(x))
is safe. Use this to automaticallypydel!
stuff where possible, e.g. in@py
.unsafe_
prefix on unsafe functions likepydel!
andpynew()
and/or remove them from the API. Recommend using@pyconst
instead.threadid() == 1
in finalisers.JuliaValue
type (orJl
?), just as all Python values in PythonCall are of the samePy
type. Implement wrappers on top of this.JuliaValue(x)
.The text was updated successfully, but these errors were encountered: