Add __contains__ method

Fixes #471
This commit is contained in:
ZyX 2013-05-01 23:56:49 +04:00
parent 98b7ed2950
commit ba33c327f5
1 changed files with 8 additions and 0 deletions

View File

@ -76,6 +76,14 @@ class Environment(object):
except IndexError:
return default
@staticmethod
def __contains__(key):
try:
zsh.getvalue(key)
return True
except IndexError:
return False
environ = Environment()