Fallback to 'hasattr next' for iterability test on Python 2.5