Skip to content

Commit 3e75258

Browse files
committed
Don't coerce operators
1 parent 9d57e6d commit 3e75258

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
src/scratch.jl
22
*.png
3+
.DS_Store

src/operators_v5.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Base: .==, .>, .<, .>=, .<=, .!=
22

33
for (op, pyop) in [(:.==, :__eq__), (:.>, :__gt__), (:.<, :__lt__), (:.>=, :__ge__), (:.<=, :__le__), (:.!=, :__ne__)]
44
@eval function $op(s::PandasWrapped, x)
5-
pandas_wrap(s.pyo[$(QuoteNode(pyop))](x))
5+
method = s.pyo[$(QuoteNode(pyop))]
6+
pandas_wrap(pycall(method, PyObject, x))
67
end
78
end

src/operators_v6.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Base: ==, >, <, >=, <=, !=
22

33
for (op, pyop) in [(:(==), :__eq__), (:>, :__gt__), (:<, :__lt__), (:>=, :__ge__), (:<=, :__le__), (:!=, :__ne__)]
44
@eval function Base.broadcast(::typeof($op), s::PandasWrapped, x)
5-
pandas_wrap(s.pyo[$(QuoteNode(pyop))](x))
5+
method = s.pyo[$(QuoteNode(pyop))]
6+
pandas_wrap(pycall(method, PyObject, x))
67
end
78
end

0 commit comments

Comments
 (0)