About limitations and mismatch in set of identifiers when using PyJulia

Yes, with either PyJulia or JuliaCall, you will need to use Main.eval (or Main.seval in the case of JuliaCall) as stevengj says to access any syntax not made available directly in the library. If you need to pass values, you can create a function and call that, e.g.

curly = Main.eval("(a,b...) -> a{b...}")
ComplexInt = curly(Main.Complex, Main.Int)

To access fields whose names are not valid Python identifiers, you can always use getattr, such as getattr(Main, "+") or getattr(Main, "push!"). The _b suffix (which JuliaCall has copied) is simply a convenience a very common case.

In JuliaCall, you can access the curly syntax for parametric types via ordinary indexing, just like for parametric type annotations in Python:

from juliacall import Main as jl
jl.Vector[jl.Int]  # Vector{Int}
jl.NTuple[3, jl.String]  # NTuple{3, String}
3 Likes