Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'nested': 0.07; 'reason,': 0.07; "subject:' ": 0.07; 'though:': 0.07; 'python': 0.09; '"a"': 0.09; 'cc:addr:python-list': 0.10; 'subject:not': 0.11; "'c'": 0.16; 'subject:item': 0.16; 'subject:object': 0.16; 'wrote:': 0.17; 'subject:support': 0.22; 'cc:2**0': 0.23; 'work.': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; '>>>>': 0.29; 'another': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'list.': 0.35; 'created': 0.36; 'but': 0.36; 'message-id:@gmail.com': 0.36; 'does': 0.37; 'item': 0.37; 'received:209': 0.37; 'object': 0.38; 'received:192': 0.39; 'received:192.168': 0.40; 'header:Received:5': 0.40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=WufZaJp6guvmrOFZo4ey6t8Cps/5n5rm5vrgEi9NMyo=; b=ys6bUW7SV2PLibByIZwBM2ZRS0/aBdw6EKua36iQ3HfKN0xDegpIthU3mR2RSSfVHR jleaqlZ4hD0gQU0ZSAR1g68X00+ZsaeeLA5HcECG2p2pm0iTxSvorn5YqhhQpPoBYBKV TQQNqRtSNyo9mOguRau1ZOPyowkas1AhrBjvwUN2gdwogU0RAq+EtA/sH1fRjzB8JHwB +ij/XodQermxz9mTsGoS14v94+nDjyYR4LluhzamuKV0BAELTC49A/K4tIGJxMLOpODh zyTwb9T7rVTlGfOBsI9p6Y/PSbr4XO19eAjypHMEiDPZOPGruA76k3hIN6ztROODCHVN haOw== Date: Sun, 23 Sep 2012 19:48:49 +0100 From: Andrea Crotti User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120910 Thunderbird/15.0.1 MIME-Version: 1.0 To: jimbo1qaz Subject: Re: 'str' object does not support item assignment References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: python-list@python.org 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348426187 news.xs4all.nl 6886 [2001:888:2000:d::a6]:41275 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29848 On 09/23/2012 07: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. But a = "a" a[0] = 'c' fails for the same reason, which is that strings in Python are immutable..