Should this PEP include changes to the struct module, or should it be a 
separate PEP?

I would like struct.pack() to return bytes and struct.unpack() to accept 
bytes or buffers but not strings.  The 's' and 'p' format specifier 
should refer to bytes and not strings.

In protocol encoding and decoding, "unpack and strip off the front" and 
"pack and append" are very common operations.  I would also like to have 
  buffer.unpack(fmt) be the former and buffer.pack(fmt, v1, v2, ...) be 
the latter.


Joel
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to