Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: =?UTF-8?Q?Nagy_L=c3=a1szl=c3=b3_Zsolt?= 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: References: <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: 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: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <917ca9c4-aef1-6681-ec70-62de8916117d@shopzeus.com> X-Mailman-Original-References: Xref: csiph.com comp.lang.python:109724 >> 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 ke= pt=20 > for backwards-compatibility, but don't find anything in the docs to sup= port=20 > this... Are you saying that for any new project, I should subclass from list and dict, instead of UserList and UserDict?