Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32774

Re: Multi-dimensional list initialization

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <demianbrecht@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.014
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'immutable': 0.09; 'referenced': 0.09; 'url:github': 0.09; 'cc:addr:python-list': 0.10; 'index': 0.13; '(assignment': 0.16; 'constitutes': 0.16; 'list)': 0.16; 'singleton': 0.16; 'value),': 0.16; 'wrote:': 0.17; 'latter': 0.22; 'subject:skip:i 10': 0.22; 'cc:2**0': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; '(as': 0.27; 'received:209.85.210.46': 0.27; 'skip:@ 10': 0.27; 'subject:list': 0.28; 'chris': 0.28; 'run': 0.28; 'unlike': 0.30; '(and': 0.32; 'more,': 0.32; 'problem': 0.33; 'received:google.com': 0.34; 'thanks': 0.34; 'list': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'message-id:@gmail.com': 0.36; 'charset:us-ascii': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'subject:-': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'link': 0.60; 'first': 0.61; 'header:Message- Id:1': 0.62; 'clearing': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=AMPluQkrBokcSjFN0dj2l+BzvUbz6884n2RyID8vCAs=; b=hPcFvQSzDy4HNFJl6PzG8e7vIvpUMg6sX00cPv4fkHMfhilkeE4Jrsh3agT6sm7laa y+W09oqL1ao0ogBrAxTg/hUi+T3pJPRV7M8iB8zXNq5eQg6sBhbZSOYMxejXSwa1TCCU mGPX38sF73lAlk5df4JqYvsy/RyQxk1utSPjblnaEO61zoQXWFibJftUMcRRPS1DLrOE q74mD2HiSbSfBW9c6sB9Yw0NJJ3mqW1r/SAzz1yy01QsgHKcOkTJH7hLQqq00mAuCR3j +douuVr29ZMZuX5awAFgovBvA5iovxac4AHtkwX4QhfkG8RK13sV9ATdwzGUoouhah1d da1w==
Content-Type text/plain; charset=us-ascii
Mime-Version 1.0 (Mac OS X Mail 6.2 \(1499\))
Subject Re: Multi-dimensional list initialization
From Demian Brecht <demianbrecht@gmail.com>
In-Reply-To <CAMZYqRRA=i=_A_eLY4pFZgh5RbZKKhY8=5pJPE=pYgsW2XjP7A@mail.gmail.com>
Date Mon, 5 Nov 2012 07:01:55 -0800
Content-Transfer-Encoding quoted-printable
References <A399B195-7ED3-42D6-A54F-299FE66EBFAE@gmail.com> <CAMZYqRRA=i=_A_eLY4pFZgh5RbZKKhY8=5pJPE=pYgsW2XjP7A@mail.gmail.com>
To Chris Rebert <clp2@rebertia.com>
X-Mailer Apple Mail (2.1499)
Cc "python-list@python.org" <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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3291.1352127722.27098.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1352127722 news.xs4all.nl 6876 [2001:888:2000:d::a6]:56292
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:32774

Show key headers only | View raw


On 2012-11-04, at 11:07 PM, Chris Rebert <clp2@rebertia.com> wrote:

> However, unlike a list object (as in your latter example), the object
> `None` is completely immutable (and what's more, a singleton value),
> so you just-so-happen *not to be able to* run into the same problem of
> mutating an object (assignment to an index of a list constitutes
> mutation of that list) that is referenced in multiple places, for you
> cannot mutate None in the first place!

Thanks for clearing that up Chris (and the link to the FAQ). I had thought about that after going to bed ("D'oh.. None is immutable.. *That's* gotta be why").

Demian Brecht
@demianbrecht
http://demianbrecht.github.com



Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Multi-dimensional list initialization Demian Brecht <demianbrecht@gmail.com> - 2012-11-05 07:01 -0800

csiph-web