Base conversion method or module

Francis Avila francisgavila at yahoo.com
Sun Dec 7 21:52:23 EST 2003


Jeff Wagner wrote in message ...
>On Mon, 8 Dec 2003 00:40:46 +0100, "Fredrik Lundh" <fredrik at pythonware.com>
wrotf:
>
>>Jeff Wagner wrote:
>>
>>> I found the Python cookbook recipe you were referring to. It is as
follows:
>>
>>(what's wrong with just posting an URL?)
>
>What a great idea ;)  ...
>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/111286

Hey, I found another one which is the more general "inverse of int/long"
function I was pining for (and thus learning for the n-th time that one
should check the cookbook first before reinventing the wheel):

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/222109

For some reason it's in the "Text" category, and uses the term "radix,"
which is less common than "base".

Hettinger's version (found in the discussion below) is better.

Shouldn't something like this get into the builtins, so we can get rid of
hex/oct in Python3k?
--
Francis Avila





More information about the Python-list mailing list