Permalink
Browse files

lib/container: Improve efficiency.

From the DictMixin documentation, __contains__(), __iter__(), and iteritems()
all improve the efficiency of things, so make sure they're all implemented.
  • Loading branch information...
1 parent ced1ca1 commit 51f8788dc0c8aed29e4a3ec8ddda0aa9611188db @MostAwesomeDude committed Sep 24, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 construct/lib/container.py
@@ -49,6 +49,12 @@ def update(self, other):
__update__ = update
+ def __contains__(self, value):
+ return value in self.__dict__
+
+ def iteritems(self):
+ return self.__dict__.iteritems()
+
# Rich comparisons.
def __eq__(self, other):

0 comments on commit 51f8788

Please sign in to comment.