Add tests for the collections helper class and sync-up with py3k branch.
diff --git a/Lib/collections.py b/Lib/collections.py
index 2f19459..98c4325 100644
--- a/Lib/collections.py
+++ b/Lib/collections.py
@@ -694,6 +694,15 @@
__copy__ = copy
+ def new_child(self): # like Django's Context.push()
+ 'New ChainMap with a new dict followed by all previous maps.'
+ return self.__class__({}, *self.maps)
+
+ @property
+ def parents(self): # like Django's Context.pop()
+ 'New ChainMap from maps[1:].'
+ return self.__class__(*self.maps[1:])
+
def __setitem__(self, key, value):
self.maps[0][key] = value