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
This commit is contained in:
Malcolm Tredinnick 2006-09-23 13:55:04 +00:00
parent 28fad23a3f
commit 35a13d4b6b
1 changed files with 3 additions and 0 deletions

View File

@ -14,6 +14,9 @@ class MergeDict(object):
pass
raise KeyError
def __contains__(self, key):
return self.has_key(key)
def get(self, key, default):
try:
return self[key]