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/2014-January/131021.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.5Antoine Pitrou solipsis at pitrou.net
Wed Jan 8 11:28:07 CET 2014
On Wed, 8 Jan 2014 11:02:19 +0100
Victor Stinner <victor.stinner at gmail.com> wrote:
> 
> > What does b'%s' % 7 do?
> 
> See Examples of the PEP:
> 
> b'a%sc%s' % (b'b', 4) gives b'abc4'
[...]
> > And then what? Use the "default" encoding? ASCII?
> 
> Bytes have no encoding. There are just bytes :-)

Therefore you shouldn't accept integers. It does not make sense to
format 4 as b'4'.

> IMO the typical usecase will by b'%s: %s' % (b'Header', binary_data)

Agreed.

Regards

Antoine.


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