SF patch 672098: Three __contains__ implementations

Contributed by Jp Calderone.
This commit is contained in:
Raymond Hettinger 2003-01-30 00:56:33 +00:00
parent 61bb35f440
commit 0e449234bf
3 changed files with 7 additions and 0 deletions

View file

@ -32,6 +32,8 @@ class _Environ:
def has_key(self, key):
value = riscos.getenv(key)
return value<>None
def __contains__(self, key):
return riscos.getenv(key) is not None
def update(self, dict):
for k, v in dict.items():
riscos.putenv(k, v)