[Python-Dev] str with base

Scott David Daniels Scott.Daniels at Acm.Org
Thu Jan 19 20:59:52 CET 2006


Raymond Hettinger wrote:
> That suggests that it would be better to simply add an int method:
>      x.convert_to_base(7)

I'd suggest allowing:

     x.convert_to_base('0123456')

Where the (str or unicode) argument is the list of digits in order.
This would allow easy converting to base-64 and other weird formats, as
well as providing decimal conversion into some unicode number ranges
outside the ASCII group.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-Dev mailing list