Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.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.013 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '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; 'aug': 0.22; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'coded': 0.31; 'ctypes': 0.31; 'decimal': 0.31; 'figure': 0.32; 'supposed': 0.32; "can't": 0.35; 'convert': 0.35; 'received:google.com': 0.35; '14,': 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; '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=cisSEcojGkvHNgdZufTCghzp20hpDKZnMOv567qzCbg=; b=by0CuXkRjkGiFXJtb4EHpoLdopwX9sgZSstS5aysDQPshWD+VVhTFOJRMbiP6wbRyj 9le26YKlPPMEaQocjLTy9mN4TE3ayfkIos3NJXY3kUhbqrCIBhruF1HEL0kdtF6NqYfc kWrwHEgvpJHsF3cCh8yFP14XcZeyB2ApPae1aRH+KhyAywCp2i6qPZNCbKx6dqBXggZO d6u3UtbY08Pm+951+VGwfHvrqhtZ78CoXg8EC2cyFOIcZTA9y7AjtQ2l0roAeFMYOd83 cGUbIjfHbmUVWc1pSO+TvCxf9ItqSeIp/xAV2bghdsPIlQCENjAUjbuQLXdjSzQI7L0v iMNQ== MIME-Version: 1.0 X-Received: by 10.52.36.236 with SMTP id t12mr181145vdj.95.1376500499750; Wed, 14 Aug 2013 10:14:59 -0700 (PDT) In-Reply-To: <1376499950.3355.9802231.6A03F40D@webmail.messagingengine.com> References: <94f8428f-50b9-4ccd-95a0-6eeafda0fe18@googlegroups.com> <1376499950.3355.9802231.6A03F40D@webmail.messagingengine.com> Date: Wed, 14 Aug 2013 18:14:59 +0100 Subject: Re: .split() Qeustion From: Chris Angelico 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376500502 news.xs4all.nl 15996 [2001:888:2000:d::a6]:57914 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52526 On Wed, Aug 14, 2013 at 6:05 PM, 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. ChrisA