Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'nested': 0.07; "subject:' ": 0.07; 'though:': 0.07; 'python': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'bug': 0.10; 'subject:not': 0.11; 'options.': 0.15; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'route,': 0.16; 'subject:item': 0.16; 'subject:object': 0.16; 'wrote:': 0.17; 'fix': 0.17; 'code.': 0.20; 'tracker': 0.20; 'subject:support': 0.22; 'work.': 0.23; 'raise': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'looks': 0.26; 'header:X-Complaints-To:1': 0.28; '>>>>': 0.29; 'statements': 0.29; 'code': 0.31; 'from:addr:yahoo.co.uk': 0.32; 'print': 0.32; 'to:addr:python- list': 0.33; 'likely': 0.33; 'another': 0.33; 'list': 0.35; 'there': 0.35; 'list.': 0.35; 'received:org': 0.36; 'created': 0.36; 'does': 0.37; 'option': 0.37; 'item': 0.37; 'data': 0.37; 'mark': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'is.': 0.62; 'forward': 0.66; 'received:2': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: 'str' object does not support item assignment Date: Sun, 23 Sep 2012 20:11:05 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-2-97-77-28.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 In-Reply-To: X-Antivirus: avast! (VPS 120923-0, 23/09/2012), Outbound message X-Antivirus-Status: Clean X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348427460 news.xs4all.nl 6915 [2001:888:2000:d::a6]:56026 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29851 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.