On 9/28/07, Joel Bender <[EMAIL PROTECTED]> wrote: > Should this PEP include changes to the struct module, or should it be a > separate PEP?
Neither. > I would like struct.pack() to return bytes and struct.unpack() to accept > bytes or buffers but not strings. This is already the case in 3.0a1. (Don't people try stuff out before posting?) > The 's' and 'p' format specifier should refer to bytes and not strings. They currently allow both, which I think is fine. > 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. IMO that would tie the buffer type too close to the struct module. You could easily write a wrapper that does this though. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ 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