In SymPy.jl
there is use of PyCall
’s pytype_mapping
to automatically convert sympy objects in Python into a typed object in Julia. It looks like in PythonCall
, the pyconvert_add_rule
does something similar, but I can’t seem to get it to work. I thought something like: PythonCall.pyconvert_add_rule("sympy.core.basic.Basic", Sym, (args...) -> print("hi"), 100)
might show me what is needed to replace pytype_mapping(sympy_core.basic.Basic, Sym)
but I’m pretty sure I’m am not specifying the first argument correctly (the underlying python type). Anyone able to offer guidance here?