irmen / Pyro5

Pyro 5 - Python remote objects
https://pyro5.readthedocs.io
MIT License
303 stars 36 forks source link

ownership concept provides no real value #71

Closed eyalk11 closed 1 year ago

eyalk11 commented 1 year ago

I understand the issue of not being thread-safe. But this feature is meant to educate developers and has no real value. So, I think it is basically wrong thing to do.

I personally use locks, and disabled the ownership check. And everything works really well. Why shouldn't you allow to do this?

__class__._Proxy__check_owner = lambda self: 1

I suggest to make it a warning that triggers once ( "make sure you are thread safe") ..

irmen commented 1 year ago

It has real value though? It's meant to educate developers (who don't read the specifications) and also it prevents data corruption and hard to reproduce problems - if the developer makes a mistake with sharing live proxies.

Another thing, the wording in the issue title is not very pleasant.

irmen commented 1 year ago

The proxy ownership rule is a fundamental design choice in Pyro5 and is not going to change.