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


Groups > comp.lang.python > #40166

Re: suggestions for improving code fragment please

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <joel.goldstick@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.088
X-Spam-Evidence '*H*': 0.83; '*S*': 0.00; 'subject:code': 0.07; 'cc:addr:python-list': 0.10; 'wrote:': 0.17; 'thu,': 0.17; 'feb': 0.19; 'cc:2**0': 0.23; 'cc:addr:python.org': 0.25; 'header:In- Reply-To:1': 0.25; 'subject:please': 0.27; 'message- id:@mail.gmail.com': 0.27; 'url:mailman': 0.29; "i'm": 0.29; 'url:python': 0.32; 'url:listinfo': 0.32; 'received:google.com': 0.34; 'thanks': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'url:org': 0.36; 'being': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'url:mail': 0.40; 'night': 0.62; '2013': 0.84; 'dumb': 0.84; 'joel': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=AFzAk63W9aAllJyLs5RtV27QPicXkZaLXLx8JklpuaY=; b=XMzVxB+sk4ryIR1GeOy1y3LiFddbbHE4cBMOK2R1o/nxvH3mtUD3YJLXGe2X/KIA24 eiX3EANmPdsg7yj/Dr5OGZFBn5vlZJqFUItlHroUYFn/9M0xKWvXFFARZbvodBwf72/K F5SQBtVMriTzn4M0yzHOXpR8qxAnpeZKLXA5aW7br67s28fhE0DITvyz9qsoojvCCo6O A2DWjLtDxvvpcwdqaOIEuORUIZO8upbsnBCtY4xrDj/Yalhnuw/TqKAFCqPybjyRCU9w 2yB4QskWEAwu6BT9FFR1G8mrGIB1osiPKNyuw2b/Ooi2bFN48/m4BTBrH7hI0KZ8f5mE BWfQ==
MIME-Version 1.0
X-Received by 10.58.220.66 with SMTP id pu2mr3017500vec.60.1362081407519; Thu, 28 Feb 2013 11:56:47 -0800 (PST)
In-Reply-To <u8idnaoktKrcKbLMnZ2dnUVZ8uednZ2d@brightview.co.uk>
References <u8idnaoktKrcKbLMnZ2dnUVZ8uednZ2d@brightview.co.uk>
Date Thu, 28 Feb 2013 14:56:47 -0500
Subject Re: suggestions for improving code fragment please
From Joel Goldstick <joel.goldstick@gmail.com>
To jkn+gg@nicorp.co.uk
Content-Type multipart/alternative; boundary=047d7bd6adba73541904d6ce4a95
Cc "python-list@python.org" <python-list@python.org>
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.2670.1362081415.2939.python-list@python.org> (permalink)
Lines 89
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1362081415 news.xs4all.nl 6920 [2001:888:2000:d::a6]:33166
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:40166

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu, Feb 28, 2013 at 2:47 PM, The Night Tripper <jkn+gg@nicorp.co.uk>wrote:

> Hi there
>     I'm being very dumb ... how can I simplify this fragment?
>
i = 0
while arglist:
    self.myparm[i] = arglist.pop(0)
    i += 1



>         if arglist:
>             arglist.pop(0)
>             if arglist:
>                 self.myparm1 = arglist.pop(0)
>                 if arglist:
>                     self.myparm2 = arglist.pop(0)
>                     if arglist:
>                         self.myparm3 = arglist.pop(0)
>                         if arglist:
>                             self.parm4 = arglist.pop(0)
>         # ...
>
>     Thanks
>     J^n
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Joel Goldstick
http://joelgoldstick.com

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


Thread

suggestions for improving code fragment please The Night Tripper <jkn+gg@nicorp.co.uk> - 2013-02-28 19:47 +0000
  Re: suggestions for improving code fragment please Rick Johnson <rantingrickjohnson@gmail.com> - 2013-02-28 11:55 -0800
  Re: suggestions for improving code fragment please Joel Goldstick <joel.goldstick@gmail.com> - 2013-02-28 14:56 -0500
    Re: suggestions for improving code fragment please The Night Tripper <jkn+gg@nicorp.co.uk> - 2013-02-28 23:20 +0000
  Re: suggestions for improving code fragment please Ian Kelly <ian.g.kelly@gmail.com> - 2013-02-28 12:58 -0700
  Re: suggestions for improving code fragment please Tim Chase <python.list@tim.thechases.com> - 2013-02-28 14:37 -0600
  Re: suggestions for improving code fragment please MRAB <python@mrabarnett.plus.com> - 2013-02-28 21:13 +0000
  Re: suggestions for improving code fragment please Mitya Sirenef <msirenef@lightbird.net> - 2013-02-28 16:22 -0500
  Re: suggestions for improving code fragment please Dave Angel <davea@davea.name> - 2013-02-28 16:28 -0500
  Re: suggestions for improving code fragment please Terry Reedy <tjreedy@udel.edu> - 2013-02-28 16:30 -0500
  Re: suggestions for improving code fragment please Tim Chase <python.list@tim.thechases.com> - 2013-02-28 16:44 -0600
  Re: suggestions for improving code fragment please Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-01 02:44 +0000

csiph-web