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


Groups > comp.lang.python > #109778

Re: UserList - which methods needs to be overriden?

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Maxime S <maxischmeii@gmail.com>
Newsgroups comp.lang.python
Subject Re: UserList - which methods needs to be overriden?
Date Fri, 10 Jun 2016 12:11:05 +0200
Lines 31
Sender maximesteisel@gmail.com
Message-ID <mailman.133.1465553487.2306.python-list@python.org> (permalink)
References <b245d88e-9b90-bb90-bd2a-13ee82f7a5c8@shopzeus.com> <CAGgTfkMakty7MohzRwLPpfRJikKBC0osTE83T0hZ9Scn+1NBOA@mail.gmail.com> <1f4d1918-1e38-abba-aca7-830d91d35bd4@shopzeus.com> <njdu7l$mu4$1@ger.gmane.org> <CAGqiJR8z63vXzxmGta1LFtkadhGBWNt0Bzp=c6kSLfxWOcrHSw@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de TNAnbEMNFFjUSQFq7vOJuQgr75MRE9dbatliVTHgKb6A==
Return-Path <maximesteisel@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'collections': 0.09; 'stating': 0.09; 'subclass': 0.09; 'subject:which': 0.09; 'python': 0.10; '2.7': 0.13; '2.2,': 0.16; 'cc:name:python': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subclassing': 0.16; 'to:addr:web.de': 0.16; 'wrote:': 0.16; 'later': 0.16; 'looked': 0.16; 'sender:addr:gmail.com': 0.18; '2.2': 0.18; 'case.': 0.18; '&gt;': 0.18; 'versions': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'wrote': 0.23; 'header:In-Reply-To:1': 0.24; 'module': 0.25; 'earlier': 0.27; 'message-id:@mail.gmail.com': 0.27; 'back.': 0.27; 'transition': 0.27; 'handful': 0.29; "i'm": 0.30; 'code': 0.30; 'point': 0.33; 'changed': 0.33; 'class': 0.33; "i'll": 0.33; 'list': 0.34; 'received:google.com': 0.35; 'received:74.125.82': 0.35; 'but': 0.36; 'cases': 0.36; 'totally': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'sure': 0.39; 'does': 0.39; 'directly.': 0.76; 'claim.': 0.84; 'confusion.': 0.84; 'nagy': 0.84; 'otten': 0.84; 'subject:needs': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=CIIKaxScXF0C9kS/XztMw4nklJ7up28do4gPUOFSj1Y=; b=M0Z0SPKdlC/fSucllQLGL5j5qa4ePo0He6jcP/6D4lb4+fqieBFt59on/1HNtJbvwZ gLwdd5xwtxFVHDT10VtOe2AYSg/wQG8ah2kRD+TV4clbnzSMHfPuAnvxx0/gHhyGx1+O ja5pS0sNlDxoGWdlaoe2YylX/Kya3UwJ/jFYvhgJaFHY0EI3mMX6fjPwTozrqCHyDO1W VCQFqERfpzwGu/CjtpNT77eiHHyesJvOLMFDLnKdDAtOb90QqPI86M/EvGelP+paCBFl 4JGnBCThZu0ejepKlvPDO5B+xLkGU3ie0hNknKbgju9hNSKG3M/JkEKU21Zqz7668A9c zrVA==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=CIIKaxScXF0C9kS/XztMw4nklJ7up28do4gPUOFSj1Y=; b=AeeEfXmSpmm2BX9gMM0iz1rS/XkFgcg0CtApG93/xLLCzoWYIxmgDy25525lEpGWWv odT/k0nuBna/wPB0m/cMf/yqmyfcoxvH1FHv8QYBlVQdqCmwmNAJPq3Vmru8x7Z62MY4 JAgtlVqjYOrf/TFJsT6XmPpyqm/I3ZzqxFvKtcKhUscPOR5phi2GE8rlr28NPx/WVRjV 5LwMiYGuH3NF7SPch8S1/VP89RbKAb804YUAoB1D6q/adUHl0icB6I4QhbvpS1lWkArn FTdApMn8iAulJ/zGjAv1zDUMd9NrUVaJbon/z8FGp5s1QZ8ymHd5IHPknWZ/ezy3ZI7t 9VyQ==
X-Gm-Message-State ALyK8tJJxXGfhz8vKGEwDToGT8LqtjHntCPgQJhQOizxjwZ4AazOpkeJNaADHJ8j/ZhEsvcwV02mlUGNgtri3A==
X-Received by 10.28.133.210 with SMTP id h201mr1836292wmd.86.1465553484768; Fri, 10 Jun 2016 03:11:24 -0700 (PDT)
In-Reply-To <njdu7l$mu4$1@ger.gmane.org>
X-Google-Sender-Auth GTiU4SJQf1qB7G38EsTSDyiZOjw
X-Content-Filtered-By Mailman/MimeDel 2.1.22
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 <CAGqiJR8z63vXzxmGta1LFtkadhGBWNt0Bzp=c6kSLfxWOcrHSw@mail.gmail.com>
X-Mailman-Original-References <b245d88e-9b90-bb90-bd2a-13ee82f7a5c8@shopzeus.com> <CAGgTfkMakty7MohzRwLPpfRJikKBC0osTE83T0hZ9Scn+1NBOA@mail.gmail.com> <1f4d1918-1e38-abba-aca7-830d91d35bd4@shopzeus.com> <njdu7l$mu4$1@ger.gmane.org>
Xref csiph.com comp.lang.python:109778

Show key headers only | View raw


2016-06-10 10:37 GMT+02:00 Peter Otten <__peter__@web.de>:
>
> Nagy László Zsolt wrote:
>
> > I'm not sure wich one is the best. Peter wrote that UserList was left in
> > collections only for backward compatiblity. This might be a point
>
> I'll take that back. I looked around and found no evidence for my claim.
> Only MutableString was removed during the transition to Python 3.
>
> Sorry for the confusion.
>
>

Up to Python 2.6, the docs of UserList had a note stating that:

This module is available for backward compatibility only. If you are
writing code that does not need to work with versions of Python earlier
than Python 2.2, please consider subclassing directly from the built-in
list type.

This was changed in Python 2.7 to:

When Python 2.2 was released, many of the use cases for this class were
subsumed by the ability to subclass list directly. However, a handful of
use cases remain.

So I think the intention was that the ability to subclass list would remove
the need to subclass UserList, but it was later realised that it is not
totally the case.

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


Thread

Re: UserList - which methods needs to be overriden? Maxime S <maxischmeii@gmail.com> - 2016-06-10 12:11 +0200

csiph-web