Octal notation: severe deprecation

PJDM PeterMayne at ap.spherion.com
Thu Jan 13 01:21:29 CET 2005

John Machin wrote:
> 1. Octal notation is of use to systems programmers on computers where
> the number of bits in a word is a multiple of 3. Are there any still
> production use? AFAIK word sizes were 12, 24, 36, 48, and 60 bits --
> all multiples of 4, so hexadecimal could be used.

The PDP-11 was 16 bit, but used octal. With eight registers and eight
addressing modes in instructions, octal was a convenient base. (On the
11/70, the front switches were marked in alternate pink and purple
groups of three. <http://www.psych.usyd.edu.au/pdp-11/11_70.html>)

> I don't see any mention of octal in GvR's "Python Regrets" or AMK's
> "PEP 3000". Why not? Is it not regretted?

I suspect that, as in other places, Python just defers to the
underlying implementation. Since the C libraries treat "0n" as octal,
so does Python. (So does JavaScript.) More "it sucks, but it's too late
to change" than regrets.

Maybe P3K will have an integer literal like "n_b" for "the integer n in
base b".


More information about the Python-list mailing list