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/131172.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
Sat Jan 11 00:24:05 CET 2014
On Fri, 10 Jan 2014 18:14:45 -0500
"Eric V. Smith" <eric at trueblade.com> wrote:
> 
> >> Because embedding the ASCII equivalent of ints and floats in byte streams
> >> is a common operation?
> > 
> > Again, if you're representing "ASCII", you're representing text and
> > should use a str object.
> 
> Yes, but is there existing 2.x code that uses %s for int and float
> (perhaps unwittingly), and do we want to "help" that code out?
> Or do we
> want to make porters first change to using %d or %f instead of %s?

I'm afraid you're misunderstanding me. The PEP doesn't allow for %d and
%f on bytes objects.

> I think what you're getting at is that in addition to not calling
> __format__, we don't want to call __str__, either, for the same reason.

Not only. We don't want to do anything that actually asks for a
*textual* representation of something. %d and %f ask for a textual
representation of a number, so they're right out.

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