[Python-3000] Weird error message from bytes type
g.brandl at gmx.net
Mon Feb 26 00:52:30 CET 2007
Thomas Wouters schrieb:
> This is because a bytes object is not a sequence of bytes objects, like
> strings. It's a sequence of small integer values, so you need to assign
> a small integer value to it. You can assign b'a' to it, or assign
> b'a' to x[:1]. I guess we could specialcase length-1 bytes to make this
> work 'naturally', but I'm not sure that's the right approach. Guido?
If it is deemed right, see attached patch.
BTW, is it intentional that the setitem/setslice code is duplicated in
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Python-3000