fixed python stackoverflow: do not create objects in sizeHint