Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'explicitly': 0.04; 'cpython': 0.05; 'function,': 0.07; 'objects,': 0.07; 'python': 0.09; 'objects.': 0.09; 'strategies.': 0.09; 'thread': 0.11; 'suggest': 0.11; 'passing': 0.15; '"value"': 0.16; 'copied,': 0.16; 'describing': 0.16; 'distinction': 0.16; 'made,': 0.16; 'pointers.': 0.16; 'value"': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'basically': 0.17; 'copied': 0.17; 'pointer': 0.17; '(not': 0.20; 'parameters': 0.20; '(by': 0.22; 'explicit': 0.22; 'subject:skip:i 10': 0.22; 'programming': 0.23; 'elements': 0.23; 'seems': 0.23; 'pass': 0.25; 'header:In-Reply-To:1': 0.25; 'language.': 0.27; 'andrew': 0.27; 'message-id:@mail.gmail.com': 0.27; 'skip:( 20': 0.28; 'subject:list': 0.28; 'all.': 0.28; 'post': 0.28; 'value)': 0.29; 'no,': 0.29; 'objects': 0.29; 'words': 0.29; 'evaluation': 0.30; 'lists': 0.31; 'point': 0.31; 'not.': 0.32; 'to:addr:python- list': 0.33; 'knowledge': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'nov': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'except': 0.36; 'but': 0.36; 'should': 0.36; 'itself': 0.37; 'does': 0.37; 'detail': 0.37; 'passed': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'fact': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'subject:-': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'lost': 0.60; 'address': 0.60; 'link': 0.60; 'first': 0.61; 'back': 0.62; 'wide': 0.62; 'between': 0.63; 'necessarily': 0.63; 'skip:n 10': 0.63; 'gave': 0.65; 'book.': 0.65; 'learned': 0.65; 'age.': 0.84; 'anywhere.': 0.84; 'etc,': 0.84; 'interesting,': 0.84; 'saying:': 0.84; '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=igm61aryc9bsMVLUiamZmfAIxi7/bdDGuWLnJ7za1m4=; b=tDcDVK+iM2BAu4jkPfFsWPLJUe/VSjLHhTQSVm1xmV9cK828NlgerULs6OsKLPGI2F mQVwl/5/jOAzSj5oT68mwY9FxAsfHF5zMo7SEzdrUXajfemmdKdmoGOnQvIzNTpqm8m/ feabdi0xHC77WfnSPlHTt2GwmKMG7bsJY84KDTIi7akBugtCDW+6Lg5GLeSlJpZ7+s8C GiCYQ6EyrEDAF6Vm7H7GxZ1E8j9VTMBehsv74zfsYZsNMYGxdzanS26RCJ/Z9govtdHZ BeymBZX1GFbUWCzu3tViVmkKkL9X5U/Pl+zUbX0DEa2czz0+9ZP/nG/z19s0SvgqHxqW 7qjw== MIME-Version: 1.0 In-Reply-To: <509ABBD4.7020200@r3dsolutions.com> References: <50978323$0$6908$e4fe514c@news2.news.xs4all.nl> <5098d2ac$0$29980$c3e8da3$5496439d@news.astraweb.com> <50999214.50100@r3dsolutions.com> <509ABBD4.7020200@r3dsolutions.com> From: Ian Kelly Date: Wed, 7 Nov 2012 14:01:19 -0700 Subject: Re: Multi-dimensional list initialization 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: 45 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352322111 news.xs4all.nl 6869 [2001:888:2000:d::a6]:33638 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32906 On Wed, Nov 7, 2012 at 12:51 PM, Andrew Robinson wrote: > Interesting, you avoided the main point "lists are copied with list > multiplication". It seems that each post is longer than the last. If we each responded to every point made, this thread would fill a book. Anyway, your point was to suggest that people would not be confused by having list multiplication copy lists but not other objects, because passing lists into functions as parameters works in basically the same way. Except that it does not work the same way, because when lists are passed into functions, they are not copied at all. Nor are are any of their contents copied, lists or not. So actually I did address this point with the "call-by-object" tangent; I just did not explicitly link it back to your thesis. > But, in any event: > Pass by value (not call by value) is a term stretching back 30 years; eg: > when I learned the meaning of the words. Rewording it as "Call by value" is > something that happened later, and the nuance is lost on those without a > very wide programming knowledge *and* age. Potayto, potahto. The distinction that you're describing is between "strict" versus "non-strict" evaluation strategies. Hinging the distinction on the non-descriptive words "call" and "pass" is lazy terminology that should never have been introduced in the first place. > In any event: > All objects in Python are based on pointers; all parameters passed to > functions, etc, are *copies* of those pointers; (by pointer value). No, all parameters passed to functions are *objects*. Python itself has no concept of pointers. What you describe is true as an implementation detail for CPython but not necessarily true for other implementations, and not true at all for an abstract (implementation-independent) view of the language. > I made the distinction between contents of the list and the list object > itself for that reason; I gave an explicit correction to the pass by "value" > generalization by saying: ("the elements are passed by reference"). The elements are not passed anywhere. Only the list object is passed to the function, which is completely agnostic of the fact that the list object happens to contain other objects.