Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.06; 'so?': 0.09; 'trailing': 0.09; 'cc:addr:python-list': 0.11; '>>': 0.16; 'from:addr:ryan': 0.16; 'newline,': 0.16; 'subject:Unicode': 0.16; 'textfile': 0.16; 'truncates': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'paul': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'that.': 0.31; 'writes:': 0.31; 'received:74.125.82': 0.34; 'received:google.com': 0.35; 'doing': 0.36; 'subject:?': 0.36; 'skip:& 10': 0.38; 'received:74.125': 0.39; 'how': 0.40; 'removing': 0.60; 'different': 0.65; 'subject:you': 0.87 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=FKlzWaNEbTW1wvN7yIWShyqFmzy5i7nQeTQcVFFTP8E=; b=I+ZEIkeHsC9WPIFG4mUCkiue7sycuA9IExYzS/kryYrOYPwv05M5HK63ADVDADT8Op Lsk0L8sfZXisMgLHCGEhT2/4Nma9bhlFr8zmKubMsYBenlw5UnAxjkGJ7krqq60Rchi6 MoUH8k4gx9geyUgyDIeeOtl0UAHyYlNyzgOcYCpDr0gRpwbDQTznbToz1AzyMejGg8DF zvmXKiein4+ultnw37CSfjH/I9UG6PoVFkllN8wHiAXmUrECU3GeDUFXT9IRAvOinQMW DKNCs38U8B62KTPLzB2pt5043/AJU014hVjqKYz2yPJ6/Eo36f/Ydp6aK3m8KxMtCTJQ hQ1Q== X-Gm-Message-State: ALoCoQnv17MnUI/XIGQEI6w7VR4qidHhXam/VeiC3XPehyx1lXGY0MejqACgx585W3QlC/7Z//1j MIME-Version: 1.0 X-Received: by 10.180.94.163 with SMTP id dd3mr836094wib.26.1401994325109; Thu, 05 Jun 2014 11:52:05 -0700 (PDT) X-Originating-IP: [98.172.7.178] In-Reply-To: References: <7xr433z0g3.fsf@ruckus.brouhaha.com> Date: Thu, 5 Jun 2014 13:52:04 -0500 Subject: Re: Unicode and Python - how often do you index strings? From: Ryan Hiebert To: Johannes Bauer Content-Type: multipart/alternative; boundary=f46d04462e5eb9c73504fb1b3d79 Cc: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1401998071 news.xs4all.nl 2950 [2001:888:2000:d::a6]:35050 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72750 --f46d04462e5eb9c73504fb1b3d79 Content-Type: text/plain; charset=UTF-8 2014-06-05 13:42 GMT-05:00 Johannes Bauer : > On 05.06.2014 20:16, Paul Rubin wrote: > > Johannes Bauer writes: > >> line = line[:-1] > >> Which truncates the trailing "\n" of a textfile line. > > > > use line.rstrip() for that. > > rstrip has different functionality than what I'm doing. How so? I was using line=line[:-1] for removing the trailing newline, and just replaced it with rstrip('\n'). What are you doing differently? --f46d04462e5eb9c73504fb1b3d79 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
2014= -06-05 13:42 GMT-05:00 Johannes Bauer <dfnsonfsduifb@gmx.de>:
On 05.06.2014 20:16, Paul Rubin wrote:
> Johannes Bauer <dfnsonfsdui= fb@gmx.de> writes:
>> line =3D line[:-1]
>> Which truncates the trailing "\n" of a textfile line. >
> use line.rstrip() for that.

rstrip has different functionality than what I'm doing.

How so? I was using line=3Dline[:-1] for removing th= e trailing newline, and just replaced it with rstrip('\n'). What ar= e you doing differently?
--f46d04462e5eb9c73504fb1b3d79--