# HG changeset patch # User Siddharth Agarwal # Date 1364595799 25200 # Node ID 860d36b763ae23890c5b3e801f35b10cd12768f4 # Parent c1f416e4bc80471d1cdbc58d136b67c98793b832 dicthelpers: add docstrings for diff and join diff -r c1f416e4bc80 -r 860d36b763ae mercurial/dicthelpers.py --- a/mercurial/dicthelpers.py Mon Apr 01 13:46:32 2013 -0700 +++ b/mercurial/dicthelpers.py Fri Mar 29 15:23:19 2013 -0700 @@ -29,7 +29,18 @@ return res def diff(d1, d2, default=None): + '''Return all key-value pairs that are different between d1 and d2. + + This includes keys that are present in one dict but not the other, and + keys whose values are different. The return value is a dict with values + being pairs of values from d1 and d2 respectively, and missing values + represented as default.''' return _diffjoin(d1, d2, default, True) def join(d1, d2, default=None): + '''Return all key-value pairs from both d1 and d2. + + This is akin to an outer join in relational algebra. The return value is a + dict with values being pairs of values from d1 and d2 respectively, and + missing values represented as default.''' return _diffjoin(d1, d2, default, False)