We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
__rmul__
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is a small demo to reproduce the problem:
using PythonCall struct MyArray x::Array end function Base.:*(a::MyArray, b::AbstractArray) println("calling *(MyArray, AbstractArray)") return a.x * b end function Base.:*(a::AbstractArray, b::MyArray) println("calling *(AbstractArray, MyArray)") return a * b.x end a = [1 2; 3 4] b = MyArray([4 3; 2 1]) a * b # [8 5; 20 13] pya = pyjlraw(a) # try not to use pya.__mul__() pyb = pyconvert(Py, b) # it's calling pyb.__rmul__(pya) pya * pyb # calling *(MyArray, AbstractArray) # Python ArrayValue: <jl [13 20; 5 8]>
looks like pyb.__rmul__(pya) is calling *(MyArray, AbstractArray), so gets wrong result
pyb.__rmul__(pya)
*(MyArray, AbstractArray)
The text was updated successfully, but these errors were encountered:
Thanks - all the reversed operands were not actually reversing their operands! This is fixed on the main branch now.
Sorry, something went wrong.
No branches or pull requests
Here is a small demo to reproduce the problem:
looks like
pyb.__rmul__(pya)
is calling*(MyArray, AbstractArray)
, so gets wrong resultThe text was updated successfully, but these errors were encountered: