diff --git a/src/PyCall.jl b/src/PyCall.jl index ebef0a54..c0fbd1e7 100644 --- a/src/PyCall.jl +++ b/src/PyCall.jl @@ -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"))