2 ms·
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
by amluto 4y ago
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.