[Python-Dev] Re: adding a bytes sequence type to Python

"Martin v. Löwis" martin at v.loewis.de
Sun Aug 29 02:06:54 CEST 2004


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


More information about the Python-Dev mailing list

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant