summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-21 20:15:10 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-21 20:15:10 +0000
commit6fc552f3e3e4d39a609a86b8220589382c922e0d (patch)
tree78abbd62061b6d3f937c2f1c4e703f259c1cd0ea
parent8b8fd2c44ebcde74c38ac9a04acc564cf3409909 (diff)
downloadportage-6fc552f3e3e4d39a609a86b8220589382c922e0d.tar.gz
portage-6fc552f3e3e4d39a609a86b8220589382c922e0d.tar.bz2
portage-6fc552f3e3e4d39a609a86b8220589382c922e0d.zip
Implement config.has_key() on top of __contains__ instead of vice versa.
svn path=/main/trunk/; revision=6916
-rw-r--r--pym/portage/__init__.py10
1 files changed, 5 insertions, 5 deletions
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: