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/2016-February/143261.html below:

[Python-Dev] PEP 515: Underscores in Numeric Literals

[Python-Dev] PEP 515: Underscores in Numeric Literals [Python-Dev] PEP 515: Underscores in Numeric LiteralsMRAB python at mrabarnett.plus.com
Wed Feb 10 18:08:37 EST 2016
On 2016-02-10 22:35, Brett Cannon wrote:

[snip]
>
>     Examples::
>
>          # grouping decimal numbers by thousands
>          amount = 10_000_000.0
>
>          # grouping hexadecimal addresses by words
>          addr = 0xDEAD_BEEF
>
>          # grouping bits into bytes in a binary literal
>          flags = 0b_0011_1111_0100_1110
>
>
> I assume all of these examples are possible in either the liberal or
> restrictive approaches?
>
[snip]
Strictly speaking, "0b_0011_1111_0100_1110" wouldn't be valid if an 
underscore was allowed only between digits because the "b" isn't a digit.

Similarly, "0x_FF_FF" wouldn't be valid, but "0xFF_FF" would.
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