From 071ac2deaf3804cc9a0720cfa6f7532f831a7762 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 16 Mar 2006 09:37:59 +0000 Subject: [PATCH] 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 --- pym/portage.py | 6 ++++++ 1 file changed, 6 insertions(+) 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: -- 2.26.2