[Python-ideas] Add a builtin method to 'int' for base/radix conversion (original) (raw)

Yuvgoog Greenle 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 for links.

This subject was discussed 2.5 years ago: http://mail.python.org/pipermail/python-dev/2006-January/059789.html

I opened a feature request ticket: http://bugs.python.org/issue6783

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?

RunThePun -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-ideas/attachments/20090831/739cc44b/attachment.html>



More information about the Python-ideas mailing list