[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mercurial-devel
Subject:    [PATCH 1 of 2 V2] dicthelpers: add docstrings for diff and join
From:       Siddharth Agarwal <sid0 () fb ! com>
Date:       2013-03-29 23:10:35
Message-ID: c1167c0f2bf3d31e2492.1364598635 () sid0x220
[Download RAW message or body]

# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1364595799 25200
#      Fri Mar 29 15:23:19 2013 -0700
# Node ID c1167c0f2bf3d31e2492af0b45803bc4d874502e
# Parent  15df5f169d64975148d7f0521f40cb6a70e2f590
dicthelpers: add docstrings for diff and join

diff --git a/mercurial/dicthelpers.py b/mercurial/dicthelpers.py
--- a/mercurial/dicthelpers.py
+++ b/mercurial/dicthelpers.py
@@ -29,7 +29,18 @@ def _diffjoin(d1, d2, default, compare):
     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)
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@selenic.com
http://selenic.com/mailman/listinfo/mercurial-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic