lib/pycall/pyobject_wrapper.rb in pycall-0.1.0.alpha.20170308 vs lib/pycall/pyobject_wrapper.rb in pycall-0.1.0.alpha.20170309

- old
+ new

@@ -120,44 +120,44 @@ PyCall.setitem(self, indices, value) end def +(other) other = Conversions.from_ruby(other) - value = LibPython.PyNumber_Add(self, other) + value = LibPython.PyNumber_Add(__pyobj__, other) return value.to_ruby unless value.null? raise PyError.fetch end def -(other) other = Conversions.from_ruby(other) - value = LibPython.PyNumber_Subtract(self, other) + value = LibPython.PyNumber_Subtract(__pyobj__, other) return value.to_ruby unless value.null? raise PyError.fetch end def *(other) other = Conversions.from_ruby(other) - value = LibPython.PyNumber_Multiply(self, other) + value = LibPython.PyNumber_Multiply(__pyobj__, other) return value.to_ruby unless value.null? raise PyError.fetch end def /(other) other = Conversions.from_ruby(other) - value = LibPython.PyNumber_TrueDivide(self, other) + value = LibPython.PyNumber_TrueDivide(__pyobj__, other) return value.to_ruby unless value.null? raise PyError.fetch end def **(other) other = Conversions.from_ruby(other) - value = LibPython.PyNumber_Power(self, other, PyCall.None) + value = LibPython.PyNumber_Power(__pyobj__, other, PyCall.None) return value.to_ruby unless value.null? raise PyError.fetch end def coerce(other) - [Conversions.from_ruby(other), self] + [PyObject.new(Conversions.from_ruby(other)), self] end def call(*args, **kwargs) args = PyCall::Tuple[*args] kwargs = kwargs.empty? ? PyObject.null : PyCall::Dict.new(kwargs)