New submission from Yuv Gre <ubershme...@gmail.com>:

In javascript and java each number has a toString method which allows 
for easy string representation in different bases. If the function int(x[, 
base]) exists as a builtin, the inverse should at least be 
somewhere in the standard library. Personally I believe a "to_string" 
method would work but would defeat "There should be one way to do it". 
Perhaps a method called "radix" or "base_convert" which requires a base 
to convert parameter won't take the place of str(number).

Here are a few possible implementations:
http://code.activestate.com/recipes/222109/
http://code.activestate.com/recipes/111286/
http://pastebin.com/f54dd69d6

----------
components: Interpreter Core, Library (Lib)
messages: 91958
nosy: ubershmekel
severity: normal
status: open
title: Add a builtin method to 'int' for base/radix conversion
type: feature request
versions: Python 2.7, Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6783>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to