python first to find getitem function first in a iterator, if not exist, then find iter method