From: Zac Medico Date: Thu, 21 Jun 2007 20:15:10 +0000 (-0000) Subject: Implement config.has_key() on top of __contains__ instead of vice versa. X-Git-Tag: v2.2_pre1~1201 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6fc552f3e3e4d39a609a86b8220589382c922e0d;p=portage.git Implement config.has_key() on top of __contains__ instead of vice versa. svn path=/main/trunk/; revision=6916 --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 6e2d38781..d6afb9d9d 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -2202,14 +2202,14 @@ class config(object): return match def has_key(self,mykey): - for x in self.lookuplist: - if x.has_key(mykey): - return 1 - return 0 + return mykey in self def __contains__(self, mykey): """Called to implement membership test operators (in and not in).""" - return bool(self.has_key(mykey)) + for d in self.lookuplist: + if mykey in d: + return True + return False def setdefault(self, k, x=None): if k in self: