In __getslice__, use self.__class__ instead of UserList.

This commit is contained in:
Guido van Rossum 1998-12-09 22:15:01 +00:00
parent 9819e4c5cf
commit f8b3b944aa

View File

@ -19,7 +19,7 @@ class UserList:
def __setitem__(self, i, item): self.data[i] = item
def __delitem__(self, i): del self.data[i]
def __getslice__(self, i, j):
userlist = UserList()
userlist = self.__class__()
userlist.data[:] = self.data[i:j]
return userlist
def __setslice__(self, i, j, list):