Path: csiph.com!feeder.erje.net!2.eu.feeder.erje.net!newsfeed0.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!not-for-mail From: Random832 Newsgroups: comp.lang.python Subject: Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?) Date: Wed, 23 Mar 2016 12:24:28 -0400 Lines: 19 Message-ID: References: <56e44258$0$1598$c3e8da3$5496439d@news.astraweb.com> <8737rvxs89.fsf@elektro.pacujo.net> <56e7483d$0$1608$c3e8da3$5496439d@news.astraweb.com> <56ef9787$0$1516$c3e8da3$5496439d@news.astraweb.com> <56f02196$0$1588$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 3hF+nVnges/W8ODujMopaAL2IcXWpw6MFGxhqFEpG++w== Return-Path: 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; 'received:internal': 0.09; 'subject:which': 0.09; 'wed,': 0.15; '(something': 0.16; '23,': 0.16; 'character).': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:10.202.2.44': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:compute4.internal': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'subject:?)': 0.16; 'wrote:': 0.16; 'string': 0.17; 'duplicate': 0.18; 'lawrence': 0.22; '(where': 0.23; 'header:In-Reply-To:1': 0.24; 'rest': 0.26; "skip:' 10": 0.28; 'thinks': 0.29; "i'm": 0.30; "he's": 0.33; 'behind': 0.35; 'could': 0.35; "wasn't": 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'doing': 0.38; 'received:66': 0.38; 'why': 0.39; 'goes': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.40; 'mark': 0.40; 'subject:The': 0.61; 'header:Message-Id:1': 0.61; 'mar': 0.65 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=iNm32VwoaDuCJ5HH4NWYHf7dIpk=; b=5MfPyp FX5hPC4Lq4aeFB/Q7RxWiqG6RYNRpoxUnOHLgUhFEW2En8OVjjRFj1wYbp+DT3qV zgBmneSoYBpxLIA0kTMN63fc2WdrS202BRi5QeiqU2R+7wDpNpmE+ETErdryahD2 DNSJdNb+cEvml0vbBBs/laeITknd0O/8s1tog= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=iNm32VwoaDuCJ5H H4NWYHf7dIpk=; b=feRVIWK9JCys55jpvDinRRePjUwXdPf02URjXJFx4Pg34Y9 VJWx9HaSalhmOSRD4nRMEwxpE4fgr1OOfoscJiEGvApAOB6QIXxxgVJmwzUV5S7r mIHjK+3BozCMzHOJ4pNS+eDSMJjOVd+ak9tB6G6aRHIuGmQqJPQs+Qx0qzvI= X-Sasl-Enc: u+VMWkGvkLwVS4UStlKFnTevIQPvlj7sm+xEVZVnbZcx 1458750268 X-Mailer: MessagingEngine.com Webmail Interface - ajax-eaa4717d In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105561 On Wed, Mar 23, 2016, at 12:08, Mark Lawrence wrote: > > And doing it 'Pythonically' can lead to suggestions such as the > > following the other day: > > > > c, psource = psource[0], psource[1:] > > > > (where psource is a very long string), which even I could tell, from > > knowing what goes on behind the scenes, wasn't going to work well > > (duplicating the rest of the string roughly every other character). > > > > It would work perfectly. How would it duplicate the rest of the string > roughly every other character? Er, I think he's suggesting that this would be in an inner loop (something like while psource: c, psource = psource[0], psource[1:]). What I'm not sure of is why he thinks this is pythonic.