From: Zac Medico Date: Thu, 16 Mar 2006 09:37:59 +0000 (-0000) Subject: Implement __contains__ for portage.config so that it calls has_key, enabling membersh... X-Git-Tag: v2.1_pre7~68 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=071ac2deaf3804cc9a0720cfa6f7532f831a7762;p=portage.git Implement __contains__ for portage.config so that it calls has_key, enabling membership test operators (in and not in) to work as expected. svn path=/main/trunk/; revision=2907 --- diff --git a/pym/portage.py b/pym/portage.py index cf76952d0..00f0822ae 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -1576,6 +1576,12 @@ class config: return 1 return 0 + def __contains__(self, mykey): + """Called to implement membership test operators (in and not in).""" + if self.has_key(mykey): + return True + return False + def keys(self): mykeys=[] for x in self.lookuplist: