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:
parent
28fad23a3f
commit
35a13d4b6b
|
@ -14,6 +14,9 @@ class MergeDict(object):
|
||||||
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]
|
||||||
|
|
Loading…
Reference in New Issue