Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!news.mv.net!nntp.TheWorld.com!newsfeed-00.mathworks.com!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: What other languages use the same data model as Python? Date: Tue, 3 May 2011 16:52:26 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 29 Message-ID: References: <4dbd1dbf$0$29991$c3e8da3$5496439d@news.astraweb.com> NNTP-Posting-Host: dsl.comtrol.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: reader1.panix.com 1304441546 27530 64.122.56.22 (3 May 2011 16:52:26 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Tue, 3 May 2011 16:52:26 +0000 (UTC) User-Agent: slrn/pre0.9.9-102 (Linux) Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:4553 On 2011-05-03, Mel wrote: > To illustrate the neither-fish-nor-fowl nature of Python calls: > > mwilson@tecumseth:~$ python > Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) > [GCC 4.4.3] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> def identify_call (a_list): > ... a_list[0] = "If you can see this, you don't have call-by-value" > ... a_list = ["If you can see this, you have call-by-reference"] > ... >>>> my_list = [None] >>>> identify_call (my_list) >>>> my_list > ["If you can see this, you don't have call-by-value"] > > so it's neither call-by-value nor call-by-reference as (e.g.) C or PL/I > programming would have it (don't know about Simula, so I am off topic, > actually.) It's not so wrong to think of Python's parameter handling as > ordinary assignments from outer namespaces to an inner namespace. As long as you think of "ordinary assignments" the Python way and not the C or PL/I way. :) -- Grant Edwards grant.b.edwards Yow! So this is what it at feels like to be potato gmail.com salad