On Wed, 8 Jan 2014 11:02:19 +0100
Victor Stinner <victor.stin...@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.


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to