Underscores in Python numbers

Steve Holden steve at holdenweb.com
Sat Nov 19 20:39:04 EST 2005


Steven D'Aprano wrote:
[...]
> Likewise, base conversion into arbitrary bases is not, in my opinion,
> common enough a task that support for it needs to be built into the syntax
> for literals. If somebody cares enough about it, write a module to handle
> it and try to get it included with the Python standard modules.
> 
In fact Icon managed to offer a syntax that allowed every base up to 36 
to be used: an "r" was used to indicate the radix of the literal, so hex 
453FF would be represented as "16r453FF". This worked fine. Upper- and 
lower-case letters werw regarded as equivalent.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/




More information about the Python-list mailing list