Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'value,': 0.03; 'mrab': 0.05; 'removes': 0.05; 'objects,': 0.07; 'python': 0.09; 'commonly': 0.09; 'imply': 0.09; 'semantics': 0.09; 'passing': 0.15; '"values"': 0.16; 'appends': 0.16; 'behaviour.': 0.16; 'copied,': 0.16; 'does;': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'variables': 0.17; '>>>': 0.18; 'java': 0.21; 'either.': 0.22; 'subject:skip:i 10': 0.22; 'references': 0.23; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'url:wiki': 0.26; 'functions.': 0.27; 'subject:list': 0.28; "d'aprano": 0.29; 'received:192.168.1.3': 0.29; 'steven': 0.29; 'url:wikipedia': 0.29; 'function': 0.30; 'sense': 0.31; 'received:84': 0.32; 'to:addr:python-list': 0.33; 'another': 0.33; 'list': 0.35; 'nov': 0.35; 'list.': 0.35; 'url:org': 0.36; 'anything': 0.36; 'does': 0.37; 'uses': 0.37; 'passed': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'url:en': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'subject:-': 0.40; 'time,': 0.62; 'world': 0.63; 'talking': 0.66; 'header:Reply- To:1': 0.68; 'reply-to:no real name:2**0': 0.72; 'sharing': 0.74; '(according': 0.84; 'reply-to:addr:python.org': 0.84; 'good,': 0.91 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=Bd1aI8R2 c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=1EKJ2blYo8kA:10 a=RHlel35PpJcA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=4905VYxiF58A:10 a=8pif782wAAAA:8 a=EvKb5KckbqyKxaHE-e8A:9 a=wPNLvfGTeEIA:10 a=0nF1XD0wxitMEM03M9B4ZQ==:117 X-AUTH: mrabarnett:2500 Date: Wed, 07 Nov 2012 17:17:02 +0000 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Multi-dimensional list initialization References: <50978323$0$6908$e4fe514c@news2.news.xs4all.nl> <5098d2ac$0$29980$c3e8da3$5496439d@news.astraweb.com> <50999214.50100@r3dsolutions.com> <5099ec1d$0$21759$c3e8da3$76491128@news.astraweb.com> In-Reply-To: <5099ec1d$0$21759$c3e8da3$76491128@news.astraweb.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: python-list@python.org 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: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352308622 news.xs4all.nl 6925 [2001:888:2000:d::a6]:40494 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32898 On 2012-11-07 05:05, Steven D'Aprano wrote: > On Wed, 07 Nov 2012 00:23:44 +0000, MRAB wrote: > >>> Incorrect. Python uses what is commonly known as call-by-object, not >>> call-by-value or call-by-reference. Passing the list by value would >>> imply that the list is copied, and that appends or removes to the list >>> inside the function would not affect the original list. This is not >>> what Python does; the list inside the function and the list passed in >>> are the same list. At the same time, the function does not have access >>> to the original reference to the list and cannot reassign it by >>> reassigning its own reference, so it is not call-by-reference semantics >>> either. >>> >> I prefer the term "reference semantics". > > > Oh good, because what the world needs is yet another name for the same > behaviour. > > - call by sharing > - call by object sharing > - call by object reference > - call by object > - call by value, where "values" are references > (according to the Java community) > - call by reference, where "references" refer to objects, not variables > (according to the Ruby community) > - reference semantics > > > Anything else? > > http://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_sharing > The disadvantage of calling it "call by ..." is that it suggests that you're just talking about calling functions. What about binding in general, eg "x = y"? Does it make sense to still call it "call by ..."?