From: Ansgar Burchardt Date: Thu, 14 Jun 2012 17:38:31 +0000 (+0200) Subject: config.py: Add __contains__ method X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bf86e38837121c738aae1eb5e1dbdaf69656198;p=dak config.py: Add __contains__ method --- diff --git a/daklib/config.py b/daklib/config.py index 7e3c8bac..1e9299f2 100755 --- a/daklib/config.py +++ b/daklib/config.py @@ -85,7 +85,10 @@ class Config(object): self.find_b = self.Cnf.find_b def has_key(self, name): - return self.Cnf.has_key(name) + return name in self.Cnf + + def __contains__(self, name): + return name in self.Cnf def __getitem__(self, name): return self.Cnf[name]