diff options
| author | Guido van Rossum <guido@python.org> | 2000-09-01 19:25:51 (GMT) |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 2000-09-01 19:25:51 (GMT) |
| commit | 8d691c842289cf4453f282637765f07113a7cc17 (patch) | |
| tree | 3a7819d53d7578cf728d3bcfecba7daebb6981db /Lib/dos-8x3/userlist.py | |
| parent | 29201d490511b2af863e07fdf5cb247fc9117c2f (diff) | |
| download | cpython-8d691c842289cf4453f282637765f07113a7cc17.zip cpython-8d691c842289cf4453f282637765f07113a7cc17.tar.gz cpython-8d691c842289cf4453f282637765f07113a7cc17.tar.bz2 | |
The usual
Diffstat (limited to 'Lib/dos-8x3/userlist.py')
| -rwxr-xr-x | Lib/dos-8x3/userlist.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/dos-8x3/userlist.py b/Lib/dos-8x3/userlist.py index d4a8d2f..1146060 100755 --- a/Lib/dos-8x3/userlist.py +++ b/Lib/dos-8x3/userlist.py @@ -51,9 +51,20 @@ class UserList: return self.__class__(other + self.data) else: return self.__class__(list(other) + self.data) + def __iadd__(self, other): + if isinstance(other, UserList): + self.data += other.data + elif isinstance(other, type(self.data)): + self.data += other + else: + self.data += list(other) + return self def __mul__(self, n): return self.__class__(self.data*n) __rmul__ = __mul__ + def __imul__(self, n): + self.data *= n + return self def append(self, item): self.data.append(item) def insert(self, i, item): self.data.insert(i, item) def pop(self, i=-1): return self.data.pop(i) |
