FAQ




Copying objects

Two names referencing the same mutable object. Pointers, references, and how things are different in C++

 

Why list (mutable) cannot be a dict key

 

thread (see Sion Arrowsmith reply)

 

d = {}

k = 1, 2

dk = None

 

Now, if I were to do:

 

k.append(3)

 

what would you expect:

 

d.keys()

 

Optimizing Python code for speed

thread scramble 20MB file: from 70 sec to 2.8 sec