Re: Serialization of return value (2)

Irmen de Jong <[email protected]> Sun, 26 Oct 2014 23:33:25 +0100
Newsgroups gmane.comp.python.pyro
Message-ID <[email protected]>
On 23-10-2014 22:55, Bořek Patzák wrote:
> 
> Hello,
> I have encountered a strange problem with return value from remote 
> class, when using pickle protocol.
> When type of return value is a class, then depending whether it is 
> derived from object base or not, the return value is different.
> When I run a client, the following response is received:
> $ python client.py
> Uri: PYRO:[email protected]:9091
> Server: <Pyro4.core.Proxy at 0x7f1592605510, not connected, for 
> PYRO:[email protected]:9091>
> a: PYRO:[email protected]:9091
> b: <Pyro4.core.Proxy at 0x7f1592605610, not connected, for 
> PYRO:[email protected]:9091>
> finished
> 

[snip]

> 1) is this intended behaviour?

Yes, this is Pyro's autoproxying behavior which is turned on by default.
See https://pythonhosted.org/Pyro4/servercode.html#autoproxying

> 2) for classes derived from object base, can the the type of return 
> value (local copy instead of URI) changed?

Yes, disable the autoproxy setting.

Anyway you should not use old-style classes really. Pyro4 won't support them. I guess
I'll have to add a check in the daemon that prevents registering old-style class instances.


Irmen


------------------------------------------------------------------------------
_______________________________________________
Pyro-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyro-core