3 ms·
> "\x01\x02".encode('zlib') for instance is a bytes to bytes operation. I think the inclusion of things like zlib (or rot13 or whatever) was a conceptual error
by kenko 11y ago
> "\x01\x02".encode('zlib') for instance is a bytes to bytes operation.
I think the inclusion of things like zlib (or rot13 or whatever) was a conceptual error that just fosters confusion.
- the_mitsuhiko 11y ago> I think the inclusion of things like zlib (or rot13 or whatever) was a conceptual error that just fosters confusion. We should not optimize languages for idiots. There is nothing confusing about such an operation for anyone who can use their brain. Python 3 still contains those operations but instead of x.encode(y) you now do encode(x, y).
- bpicolo 11y agoThe principle of least astonishment and optimizing for idiocy are not the same thing.
- the_mitsuhiko 11y agoHow is an attribute error clearer than an exception that says something like: operation does not make sense of this type?