[Python-ideas] Adding 'bytes' as alias for 'latin_1' codec.

Greg Ewing greg.ewing at canterbury.ac.nz
Fri May 27 01:34:51 CEST 2011


Masklinn wrote:

> would it make more sense to be able to create "byte patterns",
> with formats similar to those of str.format but not identical (e.g. better
> control on layout would be nice, something similar to Erlang's bit syntax for
> putting binaries together).

Sounds a lot like struct.pack. Maybe struct.pack and struct.unpack
could be made available as methods of bytes?

I don't think this would address the OP's use case, though, because
he seems to actually want a textual format whose output is encoded
in ascii.

-- 
Greg



More information about the Python-ideas mailing list