diff options
author | Thomas Wouters <thomas@python.org> | 2007-08-30 22:57:53 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2007-08-30 22:57:53 (GMT) |
commit | d2cf20eea2338a0369d4a5707adb01b201f7dfb2 (patch) | |
tree | 59fd4a094906997ae2b0cd520ff09010457da680 /Lib/UserList.py | |
parent | 582b5866174d20f7c027cbb6fb757fefb382f96f (diff) | |
download | cpython-d2cf20eea2338a0369d4a5707adb01b201f7dfb2.zip cpython-d2cf20eea2338a0369d4a5707adb01b201f7dfb2.tar.gz cpython-d2cf20eea2338a0369d4a5707adb01b201f7dfb2.tar.bz2 |
Remove the simple slicing API. All slicing is now done with slice objects.
Diffstat (limited to 'Lib/UserList.py')
-rw-r--r-- | Lib/UserList.py | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/Lib/UserList.py b/Lib/UserList.py index 072f6a7..116122f 100644 --- a/Lib/UserList.py +++ b/Lib/UserList.py @@ -28,20 +28,6 @@ class UserList: def __getitem__(self, i): return self.data[i] def __setitem__(self, i, item): self.data[i] = item def __delitem__(self, i): del self.data[i] - def __getslice__(self, i, j): - i = max(i, 0); j = max(j, 0) - return self.__class__(self.data[i:j]) - def __setslice__(self, i, j, other): - i = max(i, 0); j = max(j, 0) - if isinstance(other, UserList): - self.data[i:j] = other.data - elif isinstance(other, type(self.data)): - self.data[i:j] = other - else: - self.data[i:j] = list(other) - def __delslice__(self, i, j): - i = max(i, 0); j = max(j, 0) - del self.data[i:j] def __add__(self, other): if isinstance(other, UserList): return self.__class__(self.data + other.data) |