On Mon, Jan 13, 2014 at 2:05 PM, Brett Cannon <[email protected]> wrote:
I have been going on the assumption that bytes.format() would change what
'{}' meant for itself and would only interpolate bytes. That convenient
between Python 2 and 3 since it represents what we want it to (str and bytes
under the hood, respectively), so it just falls through. We could also add a
'b' conversion for bytes() explicitly so as to help people not accidentally
mix up things in bytes.format() and str.format(). But I was not suggesting
adding a specific format spec for bytes but instead making bytes.format()
just do the .encode('ascii') automatically to help with compatibility when a
format spec was present. If people want fancy formatting for bytes they can
always do it themselves before calling bytes.format().
This seems hastily written (e.g. verb missing :-), and I'm not clear
on what you are (or were) actually proposing. When exactly would
bytes.format() need .encode('ascii')?
I would be happy to wait a few hours or days for you to to write it up
clearly, rather than responding in a hurry.