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/2014-January/131034.html below:

[Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5

[Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5 [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5Victor Stinner victor.stinner at gmail.com
Wed Jan 8 18:25:16 CET 2014
2014/1/8 Ethan Furman <ethan at stoneleaf.us>:
>> Therefore you shouldn't accept integers. It does not make sense to
>> format 4 as b'4'.
>
> Agreed.  I would have that it would result in b'\x04'.

The PEP proposes b'%c' % 4 => b'\x04.

Antoine gave me a good argument against supporting b'%s' % int: how
would int subclasses be handled? int has no __bytes__() nor
__bformat__() method. bytes(int) returns a string of null bytes.

I'm maybe simpler to only support %s format with bytes-like objects
(bytes, bytearray, memoryview).

Victor
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