A RetroSearch Logo

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

Search Query:

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

[Python-Dev] str with base

[Python-Dev] str with base [Python-Dev] str with baseGuido van Rossum guido at python.org
Wed Jan 18 05:25:49 CET 2006
On 1/17/06, Bob Ippolito <bob at redivi.com> wrote:
> There shouldn't be a %B for the same reason there isn't an %O or %D
> -- they're all just digits, so there's not a need for an uppercase
> variant.

Right.

> The difference between hex() and oct() and the proposed binary() is

I'd propose bin() to stay in line with the short abbreviated names.

> that hex() and oct() return valid Python expressions in that base.
> In order for it to make sense, Python would need to grow some syntax.

Fair enough. So let's define it.

> If Python were to have syntax for binary literals, I'd propose a
> trailing b: "1100b".  It would be convenient at times to represent
> bit flags, but I'm not sure it's worth the syntax change.

Typically, suffixes are used to indicated *types*: 12L, 12j, and even
12e0 in some sense.

The binary type should have a 0b prefix.

Perhaps this could be implemented at the PyCon sprint?

--
--Guido van Rossum (home page: http://www.python.org/~guido/)
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