Re: UserList from module collections

2019-09-10 Thread Gregory Ewing
ast wrote: So what UserList is used for ? It's mostly a leftover from the days when you couldn't subclass built-in types. But it can still be useful if you want a custom sequence object that doesn't inherit all of the built-in list type's behaviour. -- Greg -- https://mail.python.org/mailman/

UserList from module collections

2019-09-10 Thread ast
Hello I read in a course that class UserList from module collections can be used to create our own custom list Example >>> from collections import UserList >>> class MyList(UserList): ... def head(self): ... return self.data[0] ... def queue(self): ...