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?

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Nagy László Zsolt <gandalf@shopzeus.com>
Newsgroups comp.lang.python
Subject Re: UserList - which methods needs to be overriden?
Date Thu, 9 Jun 2016 12:40:56 +0200
Lines 17
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>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de bBpVbA0RiIXD7WNt+HtdrQeo262Hgf0ZgEq2QpC6Gu+Q==
Return-Path <gandalf@shopzeus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.101
X-Spam-Level *
X-Spam-Evidence '*H*': 0.80; '*S*': 0.00; 'subclass': 0.09; 'subject:which': 0.09; 'received:io': 0.16; 'received:psf.io': 0.16; 'project,': 0.18; 'thanks.': 0.18; 'saying': 0.22; 'header :In-Reply-To:1': 0.24; 'checking': 0.27; 'skip:s 30': 0.31; 'source': 0.33; 'list': 0.34; 'but': 0.36; 'should': 0.36; 'instead': 0.36; 'there': 0.36; 'possible': 0.36; 'to:addr:python- list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'thought': 0.37; 'anything': 0.38; 'easily': 0.39; 'to:addr:python.org': 0.40; 'skip:u 10': 0.61; 'dict,': 0.84; 'this...': 0.84; 'subject:needs': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=shopzeus.com; s=shopzeus_com; t=1465468853; bh=dWMZfcO0ogESe5fgoI2+OFdtk5nfCrHRH2IqIRIe78E=; h=Subject:To:References:From:Date:In-Reply-To:From; b=Enh6wBq4r4D1AFrQ29tKnZgoywP9TDymOJFynalLjljSePCxe9r/NnnZz+1vK7Uga 4oBXI0TPO0jzh62s9St5zGSMk8UnOdsz3f3XcWzCUb6F8QHbhQbBJup7Gryrr74LuY EHMp0Q5ebNq4B1eZttjeTb4zmw8E4Dq5+GhiDeA8+4Q/A/B4yzNNv7GAza1eLXjGef sVZOC5stmMQViGFp90vjnxjn2s+bNvXYgBOG/GX9Qkfsv0jlk1Zai6mRfyFjy/16Lz gAWd3wQV2Zl5GH0VtG8hqNW9nIDX/giGics+n7pY53hfcDDVxkUO633enKx2+RCvWl ZvXoyxZcGFqmg==
In-Reply-To <njbdhk$pv2$1@ger.gmane.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <917ca9c4-aef1-6681-ec70-62de8916117d@shopzeus.com>
X-Mailman-Original-References <b245d88e-9b90-bb90-bd2a-13ee82f7a5c8@shopzeus.com> <njbdhk$pv2$1@ger.gmane.org>
Xref csiph.com comp.lang.python:109724

Show key headers only | 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