[Tutor] Correct style of line break when chaining methods

Cameron Simpson cs at cskk.id.au
Thu Jul 15 20:12:43 EDT 2021


On 13Jul2021 13:21, DL Neil <PyTutor at DancesWithMice.info> wrote:
>On 13/07/2021 00.44, Richard Damon wrote:
>> On 7/11/21 10:52 PM, dn via Tutor wrote:
>>> 1 I can't remember why "79", instead of the 80-column preceding
>>> 'standard' (which also followed punched cards, even when
>>> terminals/screens were capable of more than 24x80 - but back-then some
>>> languages mandated the use of the first columns and perhaps also the
>>> last). Perhaps the 80th column would be where the "\" line-continuation
>>> character fits?
>
>Thanks @Richard and @Dennis for the trips down 'memory lane'. Yes, there
>were several different applications for the last (and first) columns on
>punched-cards.
>
>What I really meant was: <<<I can't remember why *Python (PEP-8) settled
>on the* "79">>>, as opposed to the full, 'round', 80 (or some other
>number of columns) - hence the "\" comment...

Another consideration is that various physical terminals had differing 
behaviour of the cursor at the very end of the line. (And many terminals 
were 80 characters.) Anyway, if you wrote a character  to column 80 the 
cursor might be on that line or the next line depending on the 
terminal's behaviour. Particularly, if you did that on the bottom line 
of the screen the terminal might scroll. Or not. This makes things hard 
for full screen programmes such as visual editors etc.

The curses library etc avoided the rightmost column for this kind of 
reason IIRC.

Anyway, the upshot of this is that on an n-column display, it is prudent 
to use n-1 characters of text.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Tutor mailing list