Only if you didn't know that b'' is an alternative to bytes(). The b''
notation is so much more compact and so much more helpful that I
really don't want to go back to it. We will somehow have to deal with
this through education and documentation.
http://bugs.python.org/issue3220
Improve Bytes
2008/6/27 Guido van Rossum <[EMAIL PROTECTED]>:
> Only if you didn't know that b'' is an alternative to bytes(). The b''
> notation is so much more compact and so much more helpful that I
> really don't want to go back to it. We will somehow have to deal with
> this through education and document
On Fri, Jun 27, 2008 at 5:16 AM, Facundo Batista
<[EMAIL PROTECTED]> wrote:
> 2008/6/26 Georg Brandl <[EMAIL PROTECTED]>:
>
>> Yes. Bytes objects are sequences of bytes, which are integers.
>> So, in short, this is the way they work.
>
> I think that the OP confusion comes from the representation.
2008/6/26 Georg Brandl <[EMAIL PROTECTED]>:
> Yes. Bytes objects are sequences of bytes, which are integers.
> So, in short, this is the way they work.
I think that the OP confusion comes from the representation.
We have a data type called bytes. They are sequences of bytes. So, I build one:
>>
nirinA raseliarison schrieb:
why the following behavior:
>>> b=b'thisisbytes'
>>> b[0] == b't'
False
>>> b[0]
116
i expected same thing as:
>>> b.startswith(b't')
True
>>> b[0:1] == b't'
True
>>> b[0:1]
b't'
>>> b[:1]
b't'
and this is a bit
> so, how do you deal with bytes in these cases?
Set your locale correctly so that the filename is properly decoded
as a string. Then, bytes will not show up.
Regards,
Martin
___
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mai
why the following behavior:
>>> b=b'thisisbytes'
>>> b[0] == b't'
False
>>> b[0]
116
i expected same thing as:
>>> b.startswith(b't')
True
>>> b[0:1] == b't'
True
>>> b[0:1]
b't'
>>> b[:1]
b't'
and this is a bit curious:
>>> b[2:5]
b'