[Tutor] Strange IndexError

Alan G alan.gauld at freenet.co.uk
Wed Jun 1 21:39:49 CEST 2005

> Traceback (most recent call last):
>   File "NeedBrain.py", line 233, in update
>     self._isNearMarker = self._markerDist < self.STAY_MIN_DIST
> IndexError: tuple assignment index out of range
> I don't see, where tuples are involved. I only compare two floats.
I've Python
> 2.3.4.

Usually when that kind of thing happens to me I've accidentally used
a comma instead of a period.

Are you sure you don't have

self,_isNearMarker = ...

So Python sees it like

a,b = True

Just a thought,

Alan G.

More information about the Tutor mailing list