A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-January/059887.html below:

[Python-Dev] str with base

[Python-Dev] str with base [Python-Dev] str with baseRaymond Hettinger raymond.hettinger at verizon.net
Wed Jan 18 17:00:03 CET 2006
> > I'd propose bin() to stay in line with the short abbreviated names.
> 
> There has been some previous discussion about removing hex()/oct()
from
> builtins for Python 3.0, IIRC.  I sure don't think bin() belongs
there.

Perhaps introduce a single function, base(val, radix=10, prefix=''), as
a universal base converter that could replace bin(), hex(), oct(), etc.

That would give us fewer builtins and provide an inverse for all the
int() conversions (i.e. arbitrary bases).  Also, it would allow an
unprefixed output which is what I usually need.


Raymond

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4