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


Groups > comp.lang.python > #52529

Re: .split() Qeustion

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'definitions': 0.07; 'exists.': 0.07; '32-bit': 0.09; 'high-level': 0.09; 'integers': 0.09; 'python': 0.11; '64-bit,': 0.16; 'big-endian': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'literals': 0.16; 'newlines': 0.16; 'portable': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'module': 0.19; '>>>': 0.22; 'code,': 0.22; 'import': 0.22; 'aug': 0.22; 'integer': 0.24; "i've": 0.25; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'tim': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'usually': 0.31; '25,': 0.31; 'chase': 0.31; 'coded': 0.31; 'ctypes': 0.31; 'decimal': 0.31; 'figure': 0.32; 'supposed': 0.32; 'copying': 0.34; "can't": 0.35; 'convert': 0.35; 'no,': 0.35; 'but': 0.35; 'received:google.com': 0.35; '14,': 0.36; 'module.': 0.36; 'doing': 0.36; "didn't": 0.36; 'should': 0.36; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'email addr:gmail.com': 0.63; '(here': 0.84; 'pasting': 0.84; 'streams': 0.84; '2013,': 0.91; 'directly.': 0.95; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=PXFfxeN9Z1l8KRytWix+XHL3nACazwbNmjCGqx+A7GM=; b=Q6SbpiXY9VkLnsHGeca6K/7xMG9Zz86N0BYYj/cP/AVddvaLAAZdMpnny3Gd6XRPKH U6m0nF27KxTMWDDBG/LY7tlsplJn6PiKlNA5h4Ag6J4YUbaD1g7qU/+zGchl24RzMGug SETEn8CTsBdJySKgiNNJLzWrt7+2GsAnyWdqzIeFZawEXSilJwQyVDEilAhkVnXCvBHy XZnQ8Rb8H1A4fkDYUHLnHFRByjZAT8egdAWP+dtmxHKXRdDIV0u6leHiGv8xV5+FaS8Y 2oHQ7VTOAiTISNqcSRIuRg+JDA0CQj7sx+2tAXh/jVmNgscy6uZ5iUxi8Fbsz69vhNva VIJw==
MIME-Version 1.0
X-Received by 10.220.43.19 with SMTP id u19mr10624555vce.3.1376502368063; Wed, 14 Aug 2013 10:46:08 -0700 (PDT)
In-Reply-To <20130814122956.5779e621@bigbox.christie.dr>
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> <mailman.571.1376481372.1251.python-list@python.org> <c9727dd8-e5c6-4569-a8cf-31c7deb0ed64@googlegroups.com> <1376499950.3355.9802231.6A03F40D@webmail.messagingengine.com> <CAPTjJmp49R96XNy9NvcsCFxO8=iTGGdTYncrBdYjxvWamkpXyw@mail.gmail.com> <20130814122956.5779e621@bigbox.christie.dr>
Date Wed, 14 Aug 2013 18:46:07 +0100
Subject Re: .split() Qeustion
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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.584.1376502377.1251.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1376502377 news.xs4all.nl 15876 [2001:888:2000:d::a6]:44511
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52529

Show key headers only | View raw


On Wed, Aug 14, 2013 at 6:29 PM, Tim Chase
<python.list@tim.thechases.com> wrote:
> On 2013-08-14 18:14, Chris Angelico wrote:
>> On Wed, Aug 14, 2013 at 6:05 PM,  <random832@fastmail.us> wrote:
>> > On Wed, Aug 14, 2013, at 10:32, wxjmfauth@gmail.com wrote:
>> >> I'm always and still be suprised by the number of hard coded
>> >> '\n' one can find in Python code when the portable (here
>> >> win)
>> >>
>> >> >>> os.linesep
>> >> '\r\n'
>> >>
>> >> exists.
>> >
>> > Because high-level code isn't supposed to use the os module
>> > directly. Text-mode streams automatically convert newlines you
>> > write to them.
>>
>> I'm always, and will still be, surprised by the number of hard coded
>> decimal integers one can find in Python code, when the portable way
>> to do it is to use ctypes and figure out whether your literals
>> should be big-endian or little-endian, 32-bit or 64-bit, etc. Yet
>> people continue to just put decimal literals in their code! It
>> can't be portable.
>
> No, no, no...you want
>
>   from sys.platform.integers import 0, 1, 2, 3, 14, 42
>
> to be portable against endian'ness and bit-width.

Oh! I didn't know about sys.platform.integers. All this time I've been
doing it manually, usually copying and pasting a block of integer
definitions from the re module. (I used to copy them from
adamant.princess.ida but some of them were buggy. 2+2 made 5, or 3, or
7, or 25, depending on need.)

ChrisA

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


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