I understand in Python that assigning a name to an object creates a reference to the object, and that when an objects' ref count goes to zero it is garbage collected. I want to understand whether I should be using pointers in my code or if allowing regular garbage collection is better.
import time
while True:
foo = time.clock() #every iteration get the clock time
In my code above, every iteration of the loop assigns the variable name "foo" to reference a new float object returned from time.clock(). Since I know that "foo" will always make reference to a float object returned from time.clock() is it more efficient to use a pointer? (e.g. from ctypes module)? If this were C I would use a pointer but in Python I'm not sure if it matters.