[Python-Dev] Re: adding a bytes sequence type to Python (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Sun Aug 29 02:06:54 CEST 2004
- Previous message: [Python-Dev] Re: adding a bytes sequence type to Python
- Next message: [Python-Dev] Re: adding a bytes sequence type to Python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Skip Montanaro wrote:
>>> b[3] = '\xfe'
I think you meant to write
b[3] = 0xfe # or byte(0xfe)
here. Assigning to an index always takes the element type in Python. It's only strings where reading an index returns the container type.
>>> b += "\xfe"
And here, you probably meant to write
b += bytes("\xfe")
Regards, Martin
- Previous message: [Python-Dev] Re: adding a bytes sequence type to Python
- Next message: [Python-Dev] Re: adding a bytes sequence type to Python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]