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/131111.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
Thu Jan 9 20:30:53 CET 2014
On Fri, 10 Jan 2014 05:26:04 +1000
Nick Coghlan <ncoghlan at gmail.com> wrote:
> 
> We should probably include format_map for consistency with the str API.

Yes, you're right.

> >However, I
> > also added bytearray into the mix, as bytearray objects should
> > generally support the same operations as bytes (and they can be useful
> > *especially* for network programming).
> 
> So we'd define the *format* string as mutable to get a mutable result out
> of the formatting operations? This seems a little weird to me.
> 
> It also seems weird for a format method on a mutable type to *not* perform
> in-place mutation.

It's consistent with bytearray.join's behaviour:

>>> x = bytearray()
>>> x.join([b"abc"])
bytearray(b'abc')
>>> x
bytearray(b'')


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