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


Groups > comp.lang.python > #109724 > unrolled thread

Re: UserList - which methods needs to be overriden?

Started byNagy László Zsolt <gandalf@shopzeus.com>
First post2016-06-09 12:40 +0200
Last post2016-06-09 12:40 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#109724 — Re: UserList - which methods needs to be overriden?

FromNagy László Zsolt <gandalf@shopzeus.com>
Date2016-06-09 12:40 +0200
SubjectRe: UserList - which methods needs to be overriden?
Message-ID<mailman.104.1465468855.2306.python-list@python.org>
>> 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?

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web