News for hackers. Stuff that matters.
Re:Rust Is a Scalable Language by amluto on Tuesday March 28, 2023 @11:45PM (#35352159)
Python also has the regrettable property that many type errors aren’t even caught at runtime. Instead you often get incorrect results with no exception.

str vs bytes confusion is a major example. If you use one where you needed the other, the results can be anywhere from inscrutable failures to hilarious. My personal favorite is if you stick bytes into a templating engine. For some reason, iterating bytes in Python yields integers (not bytes-of-length-1 or a separate byte type), and those integers can get stringized and flattened, and your webpage turns into a bunch of digits and you end up with the Matrix.

There are no comments on this comment yet.