Leading 0's syntax error in datetime.date module (Python 3.6)

bartc bc at freeuk.com
Thu May 10 16:18:37 EDT 2018


On 10/05/2018 19:51, Chris Angelico wrote:
> On Fri, May 11, 2018 at 4:31 AM, bartc <bc at freeuk.com> wrote:
>>    2x100  (4)   Binary
>>    3x100  (9)   Ternary
>>    4x100  (16)  Quaternary
>>    5x100  (25)  etc
>>    6x100  (36)
>>    7x100  (49)
>>    8x100  (64)  Octal
>>    9x100  (81)
>>    ...           (Not implemented 11x to 15x, nor 10x or 16x)
>>    0x100  (256) Hex
> 
> YAGNI much? How often do you need a base-9 literal in your code??

I've used base-4 a couple of times, but not base 9 yet, excepting when 
toying with stuff. But you need to be able to print numbers in those 
bases too [not Python, or C]:

     a := 3x2222222222           # base-3
     println a:"x9"              # displays 8888 in base-9

It's interesting to see the patterns that arise when doing arithmetic in 
mixed bases.

Anyway, those extra bases were easier to leave in than to exclude.

-- 
bartc



More information about the Python-list mailing list