[Python-ideas] Add a builtin method to 'int' for base/radix conversion
ubershmekel at gmail.com
Mon Aug 31 02:45:51 CEST 2009
I believe int(s, base) needs an inverse function to allow string
representation with different bases. An example use case is 'hashing' a
counter like video ID's on youtube, you could use a regular int internally
and publish a shorter base-62 id
This subject was discussed 2.5 years ago:
I opened a feature request ticket:
Some of the questions that remain:
1. Whether this should be a method for int or a regular function in a
standard library module like math.
2. What should the method/function be called? (base_convert, radix, etc)
What do you guys think?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas