That's not Python's fault - those are programmer errors.
Having said that, Python really has something to answer for with "encode" versus "decode" - WTF? Which is which? Which direction am I converting? I still have to look that up every single time I need to convert.
Why the heck are there not "thistothat" and "thattothis" functions in Python that are explicit about what they do?
This is something I see folks trip on. I think encode/decode are fine names actually. The problem it's that Unicode strings have decode defined at all, and similarly, that byte strings have encode defined. Byte strings should only have a decode operation and Unicode strings should only have an encode operation. Depending on your input, the wrong operations can actually succeed!
I'm pretty sure I tripped up on an issue like this on python 3.7 where I double encoded or decoded something. Can't recall the exact case but it was confusing for sure.
Having said that, Python really has something to answer for with "encode" versus "decode" - WTF? Which is which? Which direction am I converting? I still have to look that up every single time I need to convert.
Why the heck are there not "thistothat" and "thattothis" functions in Python that are explicit about what they do?