Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'nested': 0.07; "subject:' ": 0.07; 'though:': 0.07; 'sep': 0.09; 'subject:not': 0.11; 'subject:item': 0.16; 'subject:object': 0.16; 'wrote:': 0.17; 'causing': 0.20; 'assignment': 0.22; 'subject:support': 0.22; 'work.': 0.23; 'header:In-Reply-To:1': 0.25; 'looks': 0.26; 'message-id:@mail.gmail.com': 0.27; 'post': 0.28; '>>>>': 0.29; 'probably': 0.29; 'maybe': 0.29; 'error': 0.30; 'code': 0.31; 'structure': 0.32; 'running': 0.32; 'to:addr:python-list': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'along': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'list.': 0.35; 'created': 0.36; 'enough': 0.36; 'beyond': 0.37; 'does': 0.37; 'item': 0.37; 'received:209': 0.37; 'object': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'help': 0.40; 'think': 0.40; 'information': 0.63; 'here': 0.65; 'to:name:python': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=SlpnwCTSqUZkzPDjmCHDhieRBC0oZOTmvdaqNbXeeCE=; b=tfifOjoOZB74suEN1fbvEK0HuheZoNFs31XpQdcl6/yhQFJwQld7FNjuIKc/n44A+R eB8If9A0CJN7SBV2o/XhvH/M486nJmk0WnbaUZGJi7UQMRz4uYX8FLtiNLx+AuHNwNl6 d1OqJfrXM1FwOcd/nJ+G5bzwb6gKd85rnvPoc8aug1bxRsvw6tB+0ojfK3mGQyNoLx3D oDCBWL0Ohi/C1rpOtFJVZjaPapEUqLUuJQGqZBOIXFRKzC9OXwqLPLt3Z9YfRfrg4jcl k0AL24KpD0/B3wBwvQPsKwHRCKl670V4Mv5XItPqkoZDKqLh7IFnDcAHAQi5rrRryxLJ 7lmw== MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Sun, 23 Sep 2012 12:45:09 -0600 Subject: Re: 'str' object does not support item assignment To: Python Content-Type: text/plain; charset=ISO-8859-1 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348425941 news.xs4all.nl 6863 [2001:888:2000:d::a6]:35900 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29846 On Sun, Sep 23, 2012 at 12:31 PM, 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. There's not enough information to go on here to even speculate what might be causing the error, beyond "spots probably does not have the structure you think it does". Please post the code that you're actually running along with the full error traceback, and then maybe we can help you out. Also try printing the value of spots just before the assignment and see what it actually looks like.