diff options
author | Guido van Rossum <guido@python.org> | 1998-03-26 21:13:24 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-03-26 21:13:24 (GMT) |
commit | 45e2fbc2e70ef28b1f0327207f33dab3a4e825c5 (patch) | |
tree | 24cafdb6ffb07170188292a02440935291327cde /Lib/UserDict.py | |
parent | 9ea7024754f0e42d7fc70fd1c8f6f6cfbf7e1cf0 (diff) | |
download | cpython-45e2fbc2e70ef28b1f0327207f33dab3a4e825c5.zip cpython-45e2fbc2e70ef28b1f0327207f33dab3a4e825c5.tar.gz cpython-45e2fbc2e70ef28b1f0327207f33dab3a4e825c5.tar.bz2 |
Mass check-in after untabifying all files that need it.
Diffstat (limited to 'Lib/UserDict.py')
-rw-r--r-- | Lib/UserDict.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Lib/UserDict.py b/Lib/UserDict.py index 3b9b157..08f3161 100644 --- a/Lib/UserDict.py +++ b/Lib/UserDict.py @@ -4,30 +4,30 @@ class UserDict: def __init__(self): self.data = {} def __repr__(self): return repr(self.data) def __cmp__(self, dict): - if type(dict) == type(self.data): - return cmp(self.data, dict) - else: - return cmp(self.data, dict.data) + if type(dict) == type(self.data): + return cmp(self.data, dict) + else: + return cmp(self.data, dict.data) def __len__(self): return len(self.data) def __getitem__(self, key): return self.data[key] def __setitem__(self, key, item): self.data[key] = item def __delitem__(self, key): del self.data[key] def clear(self): return self.data.clear() def copy(self): - import copy - return copy.copy(self) + import copy + return copy.copy(self) def keys(self): return self.data.keys() def items(self): return self.data.items() def values(self): return self.data.values() def has_key(self, key): return self.data.has_key(key) def update(self, other): - if type(other) is type(self.data): - self.data.update(other) - else: - for k, v in other.items(): - self.data[k] = v + if type(other) is type(self.data): + self.data.update(other) + else: + for k, v in other.items(): + self.data[k] = v def get(self, key, failobj=None): - if self.data.has_key(key): - return self.data[key] - else: - return failobj + if self.data.has_key(key): + return self.data[key] + else: + return failobj |