Login
You're viewing the code4lib.social public feed.
  • Nov 10, 2026, 9:07 PM

    @ewenmcneill that does sound like an argument for it having been in Python, since the type you get from indexing a string is still a string -- I've seen programs make this mistake before.

    💬 2🔄 0⭐ 0

Replies

  • Gusprojectgus@aus.social
    Nov 10, 2026, 10:26 PM

    @cliffle @ewenmcneill I had the same thought, in fact the vague certainty that I have written this exact bug in Python more than once before (in less important circumstances).

    However, isn't that then a bug on a bug? Raw key data should be bytes, not a utf8 str. Indexing a bytes object in Python returns an int...

    💬 0🔄 0⭐ 0
  • Nov 11, 2026, 11:00 AM

    @cliffle @ewenmcneill that seems like a mistake more likely to occur with Python 2 than any modern versions.

    Indexing into a bytes object will give you integers, and you'd be fighting a lot of the APIs to use the string type for binary data.

    💬 0🔄 0⭐ 0