Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed6.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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'result,': 0.05; 'semantic': 0.07; 'suppose': 0.07; 'argument,': 0.09; 'sake': 0.09; 'weird': 0.15; 'behaviour.': 0.16; 'benefit.': 0.16; 'confusion': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'shallow': 0.16; 'wrote:': 0.17; 'certainly': 0.17; 'comparing': 0.17; 'received:209.85.214.174': 0.21; 'made.': 0.22; 'subject:skip:i 10': 0.22; 'header:In-Reply-To:1': 0.25; 'skip:[ 10': 0.26; 'andrew': 0.27; 'change,': 0.27; 'message- id:@mail.gmail.com': 0.27; 'subject:list': 0.28; 'lists': 0.31; 'could': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'nov': 0.35; 'doing': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'really': 0.36; 'but': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'copying': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'subject:-': 0.40; 'header:Received:5': 0.40; 'help': 0.40; 'think': 0.40; 'between': 0.63; 'more': 0.63; "it'd": 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=FnTfKHBnMKUENbx+P3MIq2SGw4JX9s37ZaMCRP/g0Jw=; b=R+trDIGx7k+hrJzpXAUcjAyvU1ptZrtwt4XnYCkZUKYhPQxe1La5e4w1v5QExhbaO9 MoVTuUZutyCofvfSRuwofg2177MGnLnVr38U6m9p9r5Y4AMF9S8TOeAXM8iFqwoN7SZn nopjeomsK9UCNUKM5Pd+Dq/zd4U2zf5mM47FVcc1iN+9dEAOoMoVpBl4m+cmwPMNIeHZ yjd22BKhYUtuts9N0nvqf8S6Vvo3nShuRKKeb07fCDrYTWPOEfOX5MkiQ1yuOjmvV+QZ ly1RGAGfFtSkKPK2NYlLX6jE5xJNrDwn6hS8FW7sOg7Cr+XpZsFJqewhGULlrJmTvoiu QfYw== MIME-Version: 1.0 In-Reply-To: <5098A55C.3090201@r3dsolutions.com> References: <50978323$0$6908$e4fe514c@news2.news.xs4all.nl> <5098A55C.3090201@r3dsolutions.com> Date: Tue, 6 Nov 2012 17:07:06 +1100 Subject: Re: Multi-dimensional list initialization From: Chris Angelico To: python-list@python.org 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352182028 news.xs4all.nl 6972 [2001:888:2000:d::a6]:33476 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32807 On Tue, Nov 6, 2012 at 4:51 PM, Andrew Robinson wrote: > I really don't think doing a shallow copy of lists would break anyone's > program. Well, it's a change, a semantic change. It's almost certainly going to break _something_. But for the sake of argument, we can suppose that the change could be made. Would it be the right thing to do? Shallow copying by default would result in extremely weird behaviour. All the same confusion would result, only instead of comparing [None]*4 with [[None]]*4, there'd be confusion over the difference between [[None]]*4 and [[[None]]]*4. I don't think it would help anything, and it'd result in a lot more work for no benefit. ChrisA