"convert" string to bytes without changing data (encoding)

Chris Angelico rosuav at gmail.com
Thu Mar 29 05:31:59 CEST 2012


On Thu, Mar 29, 2012 at 2:04 PM, Ross Ridge <rridge at csclub.uwaterloo.ca> wrote:
> Evan Driscoll  <driscoll at cs.wisc.edu> wrote:
>>People like you -- who write to assumptions which are not even remotely
>>guaranteed by the spec -- are part of the reason software sucks.
> ...
>>This email is a bit harsher than it deserves -- but I feel not by much.
>
> I don't see how you could feel the least bit justified.  Well meaning,
> if unhelpful, lies about the nature Python strings in order to try to
> convince someone to follow what you think are good programming practices
> is one thing.  Maliciously lying about someone else's code that you've
> never seen is another thing entirely.

Actually, he is justified. It's one thing to work in C or assembly and
write code that depends on certain bit-pattern representations of data
(although even that causes trouble - assuming that
sizeof(int)==sizeof(int*) isn't good for portability), but in a high
level language, you cannot assume any correlation between objects and
bytes. Any code that depends on implementation details is risky.

ChrisA



More information about the Python-list mailing list