Understanding Python pop() Method