UserList - which methods needs to be overriden?

Nagy László Zsolt gandalf at shopzeus.com
Thu Jun 9 06:40:56 EDT 2016


>> 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?




More information about the Python-list mailing list