﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25225	Unnecessary/Redundant __iter__ method with ListMixin class (contrib.gis.geos.mutable_list.py)?	Joshua Bixby	nobody	"The `ListMixin` class (`contrib.gis.geos.mutable_list.py`) currently has an `__iter__` method and `__getitem__` method.  Typically iteration is implemented using one or the other, not both.  Looking at the two methods, the `__iter__`method appears to be unnecessary since the Python interpreter will use `__getitem__`to iterate if `__iter__` is not present.  Also, stepping through code appears to have `__iter__` call `__getitem__`, which raises the question of why define an `__iter__` method when the interpreter can use `__getitem__`directly.

Currently, `__getitem__` can't be used properly for iteration because of the custom `IndexError` raised in the `_checkindex` method.  Switching from raising a `django.contrib.gis.geos.error.GEOSIndexError` exception to a `exceptions.IndexError` will allow for the interpreter to use `__getitem__`for iteration, which would allow removing the unnecessary or redundant `__iter__` method."	Cleanup/optimization	new	GIS	1.8	Normal		__iter__ geos gis ListMixin		Unreviewed	0	0	0	0	1	0
