Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Multi-dimensional list initialization
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chris Angelico  
View profile  
 More options Nov 6 2012, 1:07 am
Newsgroups: comp.lang.python
From: Chris Angelico <ros...@gmail.com>
Date: Tue, 6 Nov 2012 17:07:06 +1100
Local: Tues, Nov 6 2012 1:07 am
Subject: Re: Multi-dimensional list initialization
On Tue, Nov 6, 2012 at 4:51 PM, Andrew Robinson

<andr...@r3dsolutions.com> 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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.