pushyrpc / pushy

Easy-as RPC. Zero-server RPC for Python and Java.
http://github.com/pushyrpc/pushy
45 stars 18 forks source link

dictionaries are not marshalled correctly #1

Closed axw closed 12 years ago

axw commented 12 years ago

If you create a dictionary with keyword arguments, then the values are None.


Imported from Launchpad using lp2gh.

axw commented 12 years ago

(by axwalk) There exists a problem with the way dictionaries are proxied. As they are native, builtin types, Python does not always call getitem et al. - instead using native functions. For example, this occurs when instantiating a dictionary with another dictionary as an argument.

Initially, Pushy attempted to minimise communication overhead when marshalling dictionaries by not sending the keys or values - erroneously relying on keys(), values(), getitem et al. to do the work. Subsequently, the dictionary proxying was modified to send the keys. This was found to not be good enough, as this defect has found.

I have modified the dictionary proxying so that the remote dictionary is instantiated with the local dictionary's items(), as a tuple.