Binary operators (+-/*) don't auto convert to Julia Types
- Dominant language
- Julia
- Stars
- 1.5k
- Forks
- 186
- PR merge metrics
- No merged PRs in 30d
Description
```
julia> using PyCall
julia> np=pyimport("numpy")
julia> a=PyCall.NpyArray(rand(3,2), false)
PyObject array([[0.82703672, 0.52055539],
[0.33942729, 0.33577722],
[0.49147636, 0.67564576]])
julia> np.exp(a) # autoconverts to a julia type
3×2 Array{Float64,2}:
2.28653 1.68296
1.40414 1.39903
1.63473 1.9653
julia> a * 2 # does not auto convert
PyObject array([[1.65407344, 1.04111078],
[0.67885458, 0.67155445],
[0.98295273, 1.35129152]])
```
This is because in [pyoperators.jl](https://github.com/JuliaPy/PyCall.jl/blob/1d0d17d4095962613fd97021407bd10a9a51c015/src/pyoperators.jl#L11) a PyObject is returned.
Maybe to be consistent with other function calls a `convert(PyAny, ...)` should be added?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.