Skip to content

Commit

Permalink
Fixed #2791 -- Added __contains__ method (for "a in dict" checks) to …
Browse files Browse the repository at this point in the history
…MergeDict.

Thanks, Ned Batchelder.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3808 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Sep 23, 2006
1 parent 28fad23 commit 35a13d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions django/utils/datastructures.py
Expand Up @@ -14,6 +14,9 @@ def __getitem__(self, key):
pass pass
raise KeyError raise KeyError


def __contains__(self, key):
return self.has_key(key)

def get(self, key, default): def get(self, key, default):
try: try:
return self[key] return self[key]
Expand Down

0 comments on commit 35a13d4

Please sign in to comment.