"bartc" <ba...@freeuk.com> wrote:

> 
> "Scott David Daniels" <scott.dani...@acm.org> wrote in message 
> news:kn2dnszr5b0bwazxnz2dnuvz_s-dn...@pdx.net...
>> James Harris wrote:...
>>> Another option:
> 
> It can be assumed however that .9. isn't in binary?
> 
> That's a neat idea. But an even simpler scheme might be:
> 
> .octal.100
> .decimal.100
> .hex.100
> .binary.100
> .trinary.100
> 
> until it gets to this anyway:
> 
> .thiryseximal.100
> 

At some point, abandoning direct support for literals and just 
having a function that can handle different bases starts to make a 
lot of sense to me:

>>> int('100', 8)
64
>>> int('100', 10)
100
>>> int('100', 16)
256
>>> int('100', 2)
4
>>> int('100', 3)
9
>>> int('100', 36)
1296


max

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to