You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, running the same code with PyCall.jl gives a very confusing error message:
py"""classA:def__setattr__(self, name, value):if value ==0:raiseValueError(value)# set value..."""
a =py"A"()
a.a =5# OK
a.a =0# completely wrong exception:
ERROR: KeyError: key :a not found
Stacktrace:
[1] setproperty!(::PyObject, ::Symbol, ::Int64) at /users/aplavin/.julia/packages/PyCall/ttONZ/src/PyCall.jl:329
[2] top-level scope at none:0
The text was updated successfully, but these errors were encountered:
aplavin
changed the title
Wrong error reported when setting an attribute
Wrong error reported when accessing an attribute
Feb 19, 2021
Bump! In the meantime I noticed that the same KeyError is wrongly raised when getting an attribute as well, not only when setting.
Traceback points to this line:
Hi! I have a class that does some checking before setting an attribute value, like this (pure Python):
However, running the same code with PyCall.jl gives a very confusing error message:
The text was updated successfully, but these errors were encountered: