I guess this should be:
```
if hasattr(operator, "index"): # python 2.5+
    pop_size = operator.index(a.item())
else: # python 2.4
    pop_size = int(a.item())
```