Skip to content

Commit

Permalink
override setproperty
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenbauer committed Aug 12, 2018
1 parent 5ff56e9 commit 90c80e2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/PyCall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,14 @@ function setindex!(o::PyObject, v, s::Union{Symbol,AbstractString})
o
end

function setproperty!(o::PyObject, s::Symbol, v)
if s == :o
setfield(o, s, v)
else
setindex!(o, v, s)
end
end

function haskey(o::PyObject, s::Union{Symbol,AbstractString})
if ispynull(o)
throw(ArgumentError("haskey of NULL PyObject"))
Expand Down

0 comments on commit 90c80e2

Please sign in to comment.