Annoying octal notation

Derek Martin code at pizzashack.org
Mon Aug 24 16:14:25 CEST 2009


On Mon, Aug 24, 2009 at 08:56:48AM -0500, Derek Martin wrote:
> On Sun, Aug 23, 2009 at 01:13:32PM +0000, Matthew Woodcraft wrote:
> > A more common case is dates.
> 
> I suppose this is true, but [...]
> I tend to also discount this example, because when we write dates
> with leading zeros, usually it's in some variation of the form
> 08/09/2009, which, containing slashes, is a string, not a number

In fact, now that I think of it...

I just looked at some old school papers I had tucked away in a family
album.  I'm quite sure that in grammar school, I was tought to use a
date format of 8/9/79, without leading zeros.  I can't prove it, of
course, but feel fairly sure that the prevalence of leading zeros in
dates occured only in the mid to late 1980's as computers became more
prevalent in our society (no doubt because thousands of cobol
programmers writing business apps needed a way to convert dates as
strings to numbers that was easy and fit in small memory).

Assuming I'm right about that, then the use of a leading 0 to
represent octal actually predates the prevalence of using 0 in dates
by almost two decades.  And while using leading zeros in other
contexts is "familiar" to me, I would certainly not consider it
"common" by any means.  Thus I think it's fair to say that when this
syntax was selected, it was a rather good choice.

-- 
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20090824/ed968b57/attachment.sig>


More information about the Python-list mailing list