[PATCH 1 of 3 V2] util: add method to hash nested combination of python data structures

Laurent Charignon lcharignon at fb.com
Mon Jul 6 15:29:48 CDT 2015

Thanks for pointing this out.
Actually, in the end, the code in V2 does not look like the one from stack overflow at all.
It was not the case for the V1 where the code was much more similar.
I think it should be okay, does anyone know better?



> On Jul 6, 2015, at 11:53 AM, Jordi GutiƩrrez Hermoso <jordigh at octave.org> wrote:
> On Mon, 2015-07-06 at 11:42 -0700, Laurent Charignon wrote:
>> # HG changeset patch
>> # User Laurent Charignon <lcharignon at fb.com>
>> # Date 1435794507 25200
>> #      Wed Jul 01 16:48:27 2015 -0700
>> # Node ID 38cd2c6265855f0a8e65e02e2cc181921df498ca
>> # Parent  2748bf78a5bf610da4f2d90fd1eea19a3b360c04
>> util: add method to hash nested combination of python data structures
>> The goal of this series of patches is to have a method to compute the hash of
>> config objects. This will enable restarting the command server when the config
>> change.
>> This patch adds a method to compute the hash of nested combination of basic
>> data structure, it will be used to enable computing the hash of a sortdict and
>> in turn compute the hash of a config.
>> Implementation modified from:
>> https://urldefense.proofpoint.com/v1/url?u=http://stackoverflow.com/questions/5884066/hashing-a-python-dictionary&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=ovX3wDZmWBc057vX%2Bdkir5laRYh0DpiaFZ0DBnnb7ps%3D%0A&m=juYZczXav3gimJqPaa%2BRkBPsrxqgtSRSt4B7woLnB5I%3D%0A&s=a793036cc4e6f53fdc9edf049323421fdcd1d84490e35f337e6c98bf1a47c337
> Is it a trivial enough amount of code so that we don't have to worry
> about the CC-BY-SA 3.0 license on the original code?

More information about the Mercurial-devel mailing list