Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #109724

Re: UserList - which methods needs to be overriden?

From Nagy László Zsolt <gandalf@shopzeus.com>
Newsgroups comp.lang.python
Subject Re: UserList - which methods needs to be overriden?
Date 2016-06-09 12:40 +0200
Message-ID <mailman.104.1465468855.2306.python-list@python.org> (permalink)
References <b245d88e-9b90-bb90-bd2a-13ee82f7a5c8@shopzeus.com> <njbdhk$pv2$1@ger.gmane.org> <917ca9c4-aef1-6681-ec70-62de8916117d@shopzeus.com>

Show all headers | View raw


>> Is there a way to easily find out which methods of are mutating the
>> collection? Other than going over the source and checking all (normal
>> and inherited) methods?
> How about
>
> set(dir(collections.UserList)) - set(dir(collections.Sequence))
Thanks. It narrows down the list of possible methods to be examined.

> I thought it was the other way round and UserList/UserDict were only kept 
> for backwards-compatibility, but don't find anything in the docs to support 
> this...
Are you saying that for any new project, I should subclass from list and
dict, instead of UserList and UserDict?

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: UserList - which methods needs to be overriden? Nagy László Zsolt <gandalf@shopzeus.com> - 2016-06-09 12:40 +0200

csiph-web