Browse files

Fixed #2791 -- Added __contains__ method (for "a in dict" checks) to …

…MergeDict.

Thanks, Ned Batchelder.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3808 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 28fad23 commit 35a13d4b6b001b476a36f49808631ac6f8762742 @malcolmt malcolmt committed Sep 23, 2006
Showing with 3 additions and 0 deletions.
  1. +3 −0 django/utils/datastructures.py
View
3 django/utils/datastructures.py
@@ -14,6 +14,9 @@ def __getitem__(self, key):
pass
raise KeyError
+ def __contains__(self, key):
+ return self.has_key(key)
+
def get(self, key, default):
try:
return self[key]

0 comments on commit 35a13d4

Please sign in to comment.