Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.110 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.78; '*S*': 0.00; 'string': 0.09; '*before*': 0.16; 'operates': 0.16; 'subject:operators': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'from:addr:chris': 0.24; 'header:In- Reply-To:1': 0.27; 'chris': 0.29; 'received:10.0.0': 0.31; "skip:' 10": 0.31; 'received:dreamhost.com': 0.31; 'received:g.dreamhost.com': 0.31; 'subject:?': 0.36; 'received:10.0': 0.36; 'should': 0.36; 'example,': 0.37; 'received:10': 0.37; 'thank': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'length': 0.61; 'first': 0.61; 'such': 0.63; 'thomas': 0.65; 'charset:windows-1252': 0.65 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cdreimer.com; h=message-id :date:from:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; s=cdreimer.com; bh=gvEG VXyJXCisR8vBIgHiVATKPCo=; b=UaobvVlAoHaE7HpJOckHcXkHAfg8eGE5Ef5w E3KeF8ai/G7kjlpcWL/XUDt8lSpjwfujxcDQlp9y13AUGOsP6PrmAvcOCMa/TRW2 g434W/b3EP3l61hs5RaKmN5Um8KML8uesJUgw9TFcUy3ubcIxKVG0Brn+OacrWbO TOBmvoI= Date: Sat, 16 May 2015 12:55:21 -0700 From: "C.D. Reimer" User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Rule of order for dot operators? References: <3341326.d8VUBGAoep@PointedEars.de> In-Reply-To: <3341326.d8VUBGAoep@PointedEars.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1431806129 news.xs4all.nl 2948 [2001:888:2000:d::a6]:45849 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90756 On 5/16/2015 12:40 PM, Thomas 'PointedEars' Lahn wrote: > However, for greater efficiency, in general you should call .replace() > in such a way that the length of the string it operates on is > minimized. For example, if feasible, always slice *before* .replace(). Slice was how I got the slug from the URL in the first place. :) Thank you, Chris Reimer