Object Diffs

Chris Angelico rosuav at gmail.com
Mon Aug 8 18:10:25 EDT 2011


On Mon, Aug 8, 2011 at 8:50 PM, Croepha <croepha at gmail.com> wrote:
> I am doing research into doing network based propagation of python
> objects.  In order to maintain network efficiency. I wan't to just
> send the differences of python objects

You could send pickled versions of each of the object's attributes,
rather than the whole object. Then simply have a notation for "same as
before", and you are sending the delta of attributes. If your set of
important attributes is stable, this could be quite efficient. OTOH,
this won't help if your attributes are complex structures for which
you want to send detailed diffs, that won't work.

Another way would be to pickle the object, and then use any string
diff utility to find the significant portions. I don't know whether
pickle is guaranteed to be stable on dictionaries, though; you might
get a lot of "diff noise".

ChrisA



More information about the Python-list mailing list