4283 shaares
4 results
tagged
gotcha
Yesterday I've stumbled upon a very surprising bug in some Python 2 code,
related to the use of the __del__
method in a vendor library we employ at work.
Here is some minimal code that reproduces the issue I met:
class MyClass:
def __init__(self):
raise RuntimeError('Woops')
def __del__ …
Confusing corners of the unix utilities
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 …