Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: 'str' object does not support item assignment

17 views
Skip to first unread message

Mark Lawrence

unread,
Sep 23, 2012, 3:11:05 PM9/23/12
to pytho...@python.org
On 23/09/2012 19:31, jimbo1qaz wrote:
> spots[y][x]=mark fails with a "'str' object does not support item assignment" error,even though:
>>>> a=[["a"]]
>>>> a[0][0]="b"
> and:
>>>> a=[["a"]]
>>>> a[0][0]=1000000
> both work.
> Spots is a nested list created as a copy of another list.
>

Looks to me as if there are three options.
a) raise a bug report on the Python bug tracker at bugs.python.org.
b) fix your code.

As option b) is the likely route, the way forward is to put print
statements in your code so you can see what data you have *AND* what
type it is.

--
Cheers.

Mark Lawrence.

0 new messages