Closed tlambert03 closed 3 years ago
seems to me that that CMMCore class has slots in it, that restrict the possible attributes on the object. Nothing we can do about it directly. Can you check that? You'll have to wrap the class in one without slots to make it work with Pyro I think.
thanks for your response. I did actually try wrapping in another class and playing with both __slots__
and __dict__
. I got it so that the class itself could accept attributes, but it still didn't work when pyro tried to add attributes directly to the members of the class (it still led to the method_descriptor
problem)...
I'll keep playing around. thanks again
A "normal" python class doesn't have this issue so Swig is really doing something funky
Yep, I recognize that. Just wondered if it was something you'd encountered. From your experience, can you imagine any other way to implement those few _Pyro attributes rather than modifying the user object itself?
This is how Pyro works internally. It rarely is a problem. Create a normal wrapper class and delegate the methods and properties to that weird swig class, and you'll be fine.
Thanks for your time
no problem!
Hi, thanks for a very cool looking library. I'm eager to give it a shot. I'm trying to expose a SWIG-generated object (of type
SwigPyObjectType
)... and running into issues duringapi.expose
when pyro tries to assign various attributes on the members of the class:I assume this is somewhat specific to SWIG-generated objects, but I assume this "
has no attribute
" challenge has probably come up in other contexts. I'm wondering if you have any suggestions for a workaround?If you want to try the exact object I'm trying to expose:
pip install pymmcore
thanks!