4256 shaares
2 results
tagged
iteration
Last week, I made up a basic TCP server in Python, to receive log lines. To split log lines, I used the ascii line feed ascii character : \n aka 0xa in hexadecimal.
But then I wondered : could this byte appear elsewhere in the UTF8-encoded strings of text I was sending …
Consider the following Python expression:
print("".join(set("ABCDE")))
What do you think it produces ?
Not necessarily "ABCDE". Right, but you would expect the result to be consistent, isn't it ?
$ for i in {1..3}; do python2.7 -c 'print("".join(set("ABCDE")))'; done
ACBED
ACBED
ACBED
Great !
...
But with …