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


Groups > comp.lang.python > #52229

Re: Suggestion: PEP for popping slices from lists

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <joshua.landau.ws@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.046
X-Spam-Evidence '*H*': 0.91; '*S*': 0.01; 'pop': 0.05; 'subject:PEP': 0.07; 'deque': 0.16; 'mutability': 0.16; 'parameter.': 0.16; 'popping': 0.16; 'reedy': 0.16; 'index': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'normally': 0.19; 'somewhere': 0.26; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'argue': 0.31; 'index,': 0.31; 'to:name :python-list': 0.33; 'subject:from': 0.34; 'subject:lists': 0.35; 'received:google.com': 0.35; 'being': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'middle': 0.60; 'august': 0.61; 'today,': 0.61; "you're": 0.61; 'complexity': 0.84; 'hassle': 0.84; '2013': 0.98
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:content-type; bh=qzCIFNA9bD25yOCtzC87fl77NLR0oByYEkfZmRLRXHY=; b=xq4zHf0l7JUxS0XZyAEpp17knyZM7wBtVcrEYsfVyy3JUXw62lYcniuTx9QZlr11Yi CgO9ayEA4tUbWM2+/2kYlTRcyErYyufifBeS/uf7wrScXRbJanCBymkBPRYo7e9wBK9G PoEVNgha/DwpEuIAqPa5uNn8kukMXmYiHVEQBj3YclpJlo6Q93iD2c63q4+1fyKUVKUc iwr4Z7bWBk/W6534UnC9ZGIIKoIcfZeGYh27+FwtDqqEaQj8Hyp9MFl35q1C4fRkZGxX 95kBvF2PsAb6DzfgKhu9CaAUU7Ks/lyvF2tTt5hRGac7rsdth52UObraFaarBx5hEIlp Ctug==
X-Received by 10.112.33.205 with SMTP id t13mr3272695lbi.22.1375997587399; Thu, 08 Aug 2013 14:33:07 -0700 (PDT)
MIME-Version 1.0
Sender joshua.landau.ws@gmail.com
In-Reply-To <ku0tia$nkk$1@ger.gmane.org>
References <dac4873d-4111-4880-9ce5-80f4ecf11685@googlegroups.com> <mailman.345.1375956533.1251.python-list@python.org> <531d89a8-61e1-4117-b4cc-f02b3be30bb9@googlegroups.com> <mailman.347.1375960376.1251.python-list@python.org> <9bd6192b-2c71-4662-808a-fd7e74dedeb8@googlegroups.com> <ku0tia$nkk$1@ger.gmane.org>
From Joshua Landau <joshua@landau.ws>
Date Thu, 8 Aug 2013 22:32:27 +0100
X-Google-Sender-Auth SE21vJQQHgLG5Pt6oFXNNy4dm6g
Subject Re: Suggestion: PEP for popping slices from lists
To python-list <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.374.1375997589.1251.python-list@python.org> (permalink)
Lines 14
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1375997589 news.xs4all.nl 15963 [2001:888:2000:d::a6]:47495
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52229

Show key headers only | View raw


On 8 August 2013 21:03, Terry Reedy <tjreedy@udel.edu> wrote:
> If .pop were being added today, I would argue against including the index
> parameter.

GASP! That's no fair!

1) When using pop you normally want to keep the mutability available,
so iter(mylist) is a no-go.
2) When using the index, it's often somewhere in the middle that
you're popping from
3) There's always deque for deques

That said you can always use blist which has O(log n) time complexity
for these pops. It's a hassle it's not stdlib :/.

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


Thread

Suggestion: PEP for popping slices from lists Neatu Ovidiu Gabriel <neatuovi@gmail.com> - 2013-08-08 02:45 -0700
  Re: Suggestion: PEP for popping slices from lists Peter Otten <__peter__@web.de> - 2013-08-08 12:07 +0200
    Re: Suggestion: PEP for popping slices from lists Neatu Ovidiu <neatuovi@gmail.com> - 2013-08-08 03:38 -0700
      Re: Suggestion: PEP for popping slices from lists Nicholas Cole <nicholas.cole@gmail.com> - 2013-08-08 12:12 +0100
        Re: Suggestion: PEP for popping slices from lists Neatu Ovidiu <neatuovi@gmail.com> - 2013-08-08 04:40 -0700
          Re: Suggestion: PEP for popping slices from lists Skip Montanaro <skip@pobox.com> - 2013-08-08 09:20 -0500
        Re: Suggestion: PEP for popping slices from lists Neatu Ovidiu <neatuovi@gmail.com> - 2013-08-08 04:44 -0700
          Re: Suggestion: PEP for popping slices from lists Neatu Ovidiu <neatuovi@gmail.com> - 2013-08-08 04:50 -0700
            Re: Suggestion: PEP for popping slices from lists Nicholas Cole <nicholas.cole@gmail.com> - 2013-08-08 14:08 +0100
              Re: Suggestion: PEP for popping slices from lists Neatu Ovidiu <neatuovi@gmail.com> - 2013-08-08 06:32 -0700
                Re: Suggestion: PEP for popping slices from lists Nicholas Cole <nicholas.cole@gmail.com> - 2013-08-08 15:03 +0100
          Re: Suggestion: PEP for popping slices from lists Terry Reedy <tjreedy@udel.edu> - 2013-08-08 16:03 -0400
          Re: Suggestion: PEP for popping slices from lists Joshua Landau <joshua@landau.ws> - 2013-08-08 22:32 +0100
          Re: Suggestion: PEP for popping slices from lists Tim Chase <python.list@tim.thechases.com> - 2013-08-08 16:50 -0500
          Re: Suggestion: PEP for popping slices from lists Terry Reedy <tjreedy@udel.edu> - 2013-08-08 18:10 -0400

csiph-web