Open Carnou opened 7 years ago
@Carnou did you wind up fixing this? Pull requests are always welcomed.
@DanielSank, no, I never did. In the Stack Overflow chat, I said I should, but I never actually touched your code. I'm still making use of the subclass workaround, though!
Hi @DanielSank, any update on this? I was actually hoping to use your package because of this use case specifically!
@Trezorro I have not done any work on this issue. Would you like to try?
Lurker here: I tried to find out more information about python’s built in property decorator. It’s implemented in C so probably the only way forward here is to implements your own @property
decorator which integrates with observed.
For instance, this is a reimplementation of python’s property decorator which introduces caching, https://github.com/pydanny/cached-property/blob/master/cached_property.py
I would use the above decorator and debug this. At least you have the code and can set breakpoints to see what is going on.
This is largely discussed at your answer on StackOverflow, but I'll summarize here.
Using the
@observableMethod
decorator on a method that is part of a property doesn't work in (c)python 3.5. Some problem occurs when the property is correctly bound to the class instance. For example,will cause the following error when you create an instance of Bar and try to set
bar.bbb
Using explicit properties as below causes the same issue:
Interestingly, a hackneyed attempt where the property is completely distinct from the class doesn't have the issue. The following works: