Any other Python flaws?

Duncan Booth duncan at NOSPAMrcp.co.uk
Mon Jun 18 11:42:01 EDT 2001


"Tony J Ibbs (Tibs)" <tony at lsl.co.uk> wrote in 
news:mailman.992601984.7190.python-list at python.org:

> The one thing I *really* hate in Python is the fact that starting a
> number with a zero suddenly magically changes its base - yuck. One thing
> we could have done with *not* keeping from the C family.
> 
> I still remember the first time (obviously not in Python itself) I tried
> to lay a series of numerical choices out neatly (did BCPL have this
> "feature" too? was it really that far back?), and to make it neat, I
> naturally padded with spaces on the left. Humph. I just couldn't believe
> that anyone would create such a daft heffalump trap.

Hi Tibs,
   BCPL Octal constants use '#', e.g. #177 and hex constants are '#X', e.g. 
#X7F, so like the dangling else, the leading 0 was an 'improvement' brought 
in post BCPL.

BTW, I'm not really so sad as to still remember that much BCPL, I keep the 
BCPL book handy though in case of emergencies.

I think my sig in BCPL would be:
LET MONTH(P) = (TABLE 5,8,3,6,7,11,1,9,10,2,0,4)!(124864/((p%1+p%2-
p%3&#x1f)+1)%12)
but I don't have a compiler handy to check.

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list