Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #52508
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed2.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.041 |
| X-Spam-Evidence | '*H*': 0.92; '*S*': 0.00; 'definitions': 0.07; 'latter': 0.09; 'cc:addr:python-list': 0.11; '"""\\': 0.16; '"d"': 0.16; 'readable': 0.16; 'statement.': 0.16; 'to:addr:web.de': 0.16; 'sender:addr:gmail.com': 0.17; 'thanks,': 0.17; 'wrote:': 0.18; 'meant': 0.20; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'skip:" 20': 0.27; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; 'message-id:@mail.gmail.com': 0.30; 'lines': 0.31; 'strip': 0.31; 'lists': 0.32; 'agree': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; "didn't": 0.36; 'example,': 0.37; 'list': 0.37; 'problems': 0.38; 'rather': 0.38; 'skip:. 10': 0.39; 'august': 0.61; 'first': 0.61; 'save': 0.62; 'more': 0.64; 'taking': 0.65; 'otten': 0.84; 'developments': 0.95; '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:cc:content-type; bh=Z4mttdJulHGfJ2a8QcFpcx1Zt1c+XVym7X708aaykXk=; b=LB9V8lXk9kK0ZW9VA6lUzV/no+hnkTe2XvHGE7Njwi6hYVam4OLBBUf6PlctYnoBRk ddLXfn2+VunIHpQ9tQMeIPW0YdK9Emr+gLzY+64+sBEiEVaYDhxV4jND7qD0VXOJYbkc uOEqqgiQ4V6pDF2CG3Djo/yvOJt75NUu/SoK0dkaEC7kYAOTr9U1KvxTXtpIdvxAHE2q BJdcZ4nOTOlkER1avp8r6oAFp7DMViisycHvqceQgKQxQrgvVmbDDGlWljFxn7YAwdzA COplLLTgK9idJW8KnAg82E5FRa1AXSSya+inq1avpRb/Kj9c28j2mjr6hxa+hh9A3Xak urKg== |
| X-Received | by 10.152.19.70 with SMTP id c6mr8412282lae.25.1376481363663; Wed, 14 Aug 2013 04:56:03 -0700 (PDT) |
| MIME-Version | 1.0 |
| Sender | joshua.landau.ws@gmail.com |
| In-Reply-To | <kufqj5$b8d$1@ger.gmane.org> |
| References | <94f8428f-50b9-4ccd-95a0-6eeafda0fe18@googlegroups.com> <mailman.560.1376457700.1251.python-list@python.org> <teHOt.12173$Oi7.5131@fx28.am4> <CAN1F8qVsX4BpPvE4JuVoY7hzKB6fiBgPBCZczm7LQT7N1M+01w@mail.gmail.com> <kufqj5$b8d$1@ger.gmane.org> |
| From | Joshua Landau <joshua@landau.ws> |
| Date | Wed, 14 Aug 2013 12:55:23 +0100 |
| X-Google-Sender-Auth | 5C3P-Rr-R3FuxQn38lhgWwimG7U |
| Subject | Re: .split() Qeustion |
| To | Peter Otten <__peter__@web.de> |
| Content-Type | text/plain; charset=UTF-8 |
| Cc | python-list <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.571.1376481372.1251.python-list@python.org> (permalink) |
| Lines | 37 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1376481372 news.xs4all.nl 15953 [2001:888:2000:d::a6]:53653 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:52508 |
Show key headers only | View raw
On 14 August 2013 12:45, Peter Otten <__peter__@web.de> wrote:
> Joshua Landau wrote:
>> On 14 August 2013 09:30, Alister <alister.ware@ntlworld.com> wrote:
>>> I would agree with the last statement.
>>> Please write list definitions as lists rather than taking a short-cut to
>>> save a few key presses
>>
>> That's true with this example, but is:
>>
>> lines = [
>> "Developments in high-speed rail, and high-speed",
> ...
>> "same problems the latter was designed to solve."
>> ]
>>
>> really more readable than:
>>
>> lines = """\
>> Developments in high-speed rail, and high-speed
> ...
>> same problems the latter was designed to solve.
>> """[1:-1].split("\n")
>>
>> ?
>
> It's definitely more correct -- unless you meant to strip the "D" from the
> first line ;)
>
> I would use
>
> lines = """\
> Developments in high-speed rail, and high-speed
> ...
> same problems the latter was designed to solve.
> """.splitlines()
Thanks, I didn't actually know about .splitlines()!
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
.split() Qeustion eschneider92@comcast.net - 2013-08-13 21:51 -0700
Re: .split() Qeustion Gary Herron <gary.herron@islandtraining.com> - 2013-08-13 22:12 -0700
Re: .split() Qeustion Alister <alister.ware@ntlworld.com> - 2013-08-14 08:30 +0000
Re: .split() Qeustion Joshua Landau <joshua@landau.ws> - 2013-08-14 11:31 +0100
Re: .split() Qeustion Alister <alister.ware@ntlworld.com> - 2013-08-14 13:29 +0000
Re: .split() Qeustion Duncan Booth <duncan.booth@invalid.invalid> - 2013-08-15 09:15 +0000
Re: .split() Qeustion wxjmfauth@gmail.com - 2013-08-15 02:46 -0700
Re: .split() Qeustion Chris Angelico <rosuav@gmail.com> - 2013-08-15 10:54 +0100
Re: .split() Qeustion Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-15 11:22 +0000
Re: .split() Qeustion wxjmfauth@gmail.com - 2013-08-15 06:58 -0700
Re: .split() Qeustion Peter Otten <__peter__@web.de> - 2013-08-14 13:45 +0200
Re: .split() Qeustion Joshua Landau <joshua@landau.ws> - 2013-08-14 12:55 +0100
Re: .split() Qeustion wxjmfauth@gmail.com - 2013-08-14 07:32 -0700
Re: .split() Qeustion random832@fastmail.us - 2013-08-14 13:05 -0400
Re: .split() Qeustion Steven D'Aprano <steve@pearwood.info> - 2013-08-15 07:17 +0000
Re: .split() Qeustion Chris Angelico <rosuav@gmail.com> - 2013-08-14 18:14 +0100
Re: .split() Qeustion wxjmfauth@gmail.com - 2013-08-15 00:46 -0700
Re: .split() Qeustion Lele Gaifax <lele@metapensiero.it> - 2013-08-15 16:38 +0200
Re: .split() Qeustion MRAB <python@mrabarnett.plus.com> - 2013-08-15 15:54 +0100
Re: .split() Qeustion Lele Gaifax <lele@metapensiero.it> - 2013-08-15 17:30 +0200
Re: .split() Qeustion Chris Angelico <rosuav@gmail.com> - 2013-08-15 16:43 +0100
Re: .split() Qeustion Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-16 04:13 +0000
Re: .split() Qeustion Roy Smith <roy@panix.com> - 2013-08-16 00:29 -0400
Re: .split() Qeustion Dave Angel <davea@davea.name> - 2013-08-16 05:27 +0000
Re: .split() Qeustion Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-17 02:38 +0000
Re: .split() Qeustion Chris Angelico <rosuav@gmail.com> - 2013-08-17 03:45 +0100
Re: .split() Qeustion Gene Heskett <gheskett@wdtv.com> - 2013-08-16 10:30 -0400
Re: .split() Qeustion Gene Heskett <gheskett@wdtv.com> - 2013-08-16 10:24 -0400
Re: .split() Qeustion Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-08-17 11:16 +1200
Re: .split() Qeustion Ben Finney <ben+python@benfinney.id.au> - 2013-08-16 15:59 +1000
Re: .split() Qeustion Roy Smith <roy@panix.com> - 2013-08-16 07:14 -0400
Re: .split() Qeustion wxjmfauth@gmail.com - 2013-08-16 06:14 -0700
Re: .split() Qeustion Roy Smith <roy@panix.com> - 2013-08-16 09:23 -0400
Re: .split() Qeustion wxjmfauth@gmail.com - 2013-08-17 01:09 -0700
Re: .split() Qeustion Roy Smith <roy@panix.com> - 2013-08-17 07:55 -0400
Re: .split() Qeustion Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-08-18 11:30 +1200
Re: .split() Qeustion wxjmfauth@gmail.com - 2013-08-18 00:17 -0700
Re: .split() Qeustion Grant Edwards <invalid@invalid.invalid> - 2013-08-16 13:59 +0000
Re: .split() Qeustion Joshua Landau <joshua@landau.ws> - 2013-08-15 17:54 +0100
Re: .split() Qeustion Chris Angelico <rosuav@gmail.com> - 2013-08-15 19:28 +0100
Re: .split() Qeustion Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-16 04:17 +0000
Re: .split() Qeustion Joshua Landau <joshua@landau.ws> - 2013-08-15 19:40 +0100
Re: .split() Qeustion Terry Reedy <tjreedy@udel.edu> - 2013-08-15 17:40 -0400
Re: .split() Qeustion Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-16 04:22 +0000
Re: .split() Qeustion Dave Angel <davea@davea.name> - 2013-08-15 22:56 +0000
Re: .split() Qeustion Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-16 04:39 +0000
Re: .split() Qeustion Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-16 04:41 +0000
Re: .split() Qeustion Tim Chase <python.list@tim.thechases.com> - 2013-08-14 12:29 -0500
Re: .split() Qeustion Skip Montanaro <skip@pobox.com> - 2013-08-14 12:38 -0500
Re: .split() Qeustion Chris Angelico <rosuav@gmail.com> - 2013-08-14 18:46 +0100
Re: .split() Qeustion Terry Reedy <tjreedy@udel.edu> - 2013-08-14 15:45 -0400
Re: .split() Qeustion Dave Angel <davea@davea.name> - 2013-08-14 05:35 +0000
Re: .split() Qeustion eschneider92@comcast.net - 2013-08-13 22:44 -0700
Re: .split() Qeustion Krishnan Shankar <i.am.songoku@gmail.com> - 2013-08-13 22:37 -0700
.split() Qeustion "Alfonso Andalon Jr." <alfonsoandalon@gmail.com> - 2013-08-16 21:31 -0700
csiph-web