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


Groups > comp.lang.python > #68805

Re: Reading in cooked mode

From Marko Rauhamaa <marko@pacujo.net>
Newsgroups comp.lang.python
Subject Re: Reading in cooked mode
Date 2014-03-23 12:22 +0200
Organization A noiseless patient Spider
Message-ID <87eh1tjju4.fsf@elektro.pacujo.net> (permalink)
References <CAPTjJmq-DkLxwAva_pyZ2YB7H4qV5RnzsXAJQDfPVdYhT8ffOw@mail.gmail.com> <mailman.8411.1395541003.18130.python-list@python.org>

Show all headers | View raw


Cameron Simpson <cs@zip.com.au>:

> Plenty of people use editors that consider end-of-line to be a
> separator and not a terminator, leading to supposed text files lacking
> trailing newlines (or end-of-line of OS).

I use an editor (emacs) that considers the end-of-line to be a byte
among others.

> I consider this sloppy and error prone.

If any editor, emacs is smart, but it generally doesn't insert
characters on its own. I like it that way.

> So I'm happy to write code that errors if a line lacks a trailing
> newline, and thus I consider the newline to be an intergral part of
> the line.

For sure, any file reader must think the situation through. Note, for
example, that CPython doesn't require the source code file to end in a
newline.


Marko

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


Thread

Re: Reading in cooked mode (was Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary) Cameron Simpson <cs@zip.com.au> - 2014-03-23 13:16 +1100
  Re: Reading in cooked mode Marko Rauhamaa <marko@pacujo.net> - 2014-03-23 12:22 +0200

csiph-web