Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #75048
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'parameters': 0.04; 'yet.': 0.04; 'argument': 0.05; 'referring': 0.07; 'subject:Question': 0.07; '*the': 0.09; '22,': 0.09; 'function,': 0.09; 'parameter': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'referenced': 0.09; 'python': 0.11; 'assignments.': 0.16; 'elsewhere,': 0.16; 'finney': 0.16; "function's": 0.16; 'function;': 0.16; 'namespace,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:object': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'code.': 0.18; 'example': 0.22; 'header:User-Agent:1': 0.23; "aren't": 0.24; 'copied': 0.24; 'laws': 0.24; 'specify': 0.24; 'defined': 0.27; 'values': 0.27; 'gets': 0.27; 'header:X -Complaints-To:1': 0.27; 'point': 0.28; 'function': 0.29; "doesn't": 0.30; 'writes:': 0.31; 'another': 0.32; 'call.': 0.33; 'could': 0.34; 'something': 0.35; 'definition': 0.35; 'objects': 0.35; 'but': 0.35; 'there': 0.35; 'subject:?': 0.36; 'being': 0.38; 'ben': 0.38; 'to:addr:python-list': 0.38; 'anything': 0.39; 'expect': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'new': 0.61; "you're": 0.61; 'name': 0.63; 'term': 0.63; 'july': 0.63; 'refer': 0.63; 'within': 0.65; 'received:125': 0.84; 'universe': 0.84; 'cast': 0.91; 'sensibly': 0.91; 'anywhere,': 0.93 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Ben Finney <ben+python@benfinney.id.au> |
| Subject | Re: Question about Pass-by-object-reference? |
| Date | Wed, 23 Jul 2014 11:59:45 +1000 |
| References | <cc0616eb-642a-426c-a995-6665ee4c52b9@googlegroups.com> <mailman.12208.1406075253.18130.python-list@python.org> <9219a041-0d6f-4e90-b209-5fd7c50ae1fd@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 8bit |
| X-Gmane-NNTP-Posting-Host | jigong.madmonks.org |
| X-Public-Key-ID | 0xAC128405 |
| X-Public-Key-Fingerprint | 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 |
| X-Public-Key-URL | http://www.benfinney.id.au/contact/bfinney-pubkey.asc |
| X-Post-From | Ben Finney <bignose+hates-spam@benfinney.id.au> |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) |
| Cancel-Lock | sha1:ZCkKMnumVHF2b36z9v+gBaMsbDY= |
| 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 | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.12210.1406080801.18130.python-list@python.org> (permalink) |
| Lines | 38 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1406080801 news.xs4all.nl 2905 [2001:888:2000:d::a6]:55888 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:75048 |
Show key headers only | View raw
fl <rxjwg98@gmail.com> writes:
> On Tuesday, July 22, 2014 8:27:15 PM UTC-4, Terry Reedy wrote:
> > When you call a function, Python binds function parameter names to
> > argument objects in the function's local namespace, the same as in
> > name assignments. […]
> > Nothing is being 'passed'.
>
> Thanks, but I don't understand your point yet. Could you give me
> another example in which something is passed?
The point being made is that no values are is “passed” in a function
call. If you have learned that term from elsewhere, it doesn't apply
sensibly to Python.
When you have a function ‘foo’ defined to expect a parameter, and you
specify an object (say, the object you have access to by the reference
‘bar’)::
foo(bar)
What happens is that *the very same object* you're referring to by the
name ‘bar’ is then referenced by a *different* name inside the function
‘foo’. There is no passing; the same object gets a new local name
assigned to it, for use only within that function's code.
Function parameters aren't passed anywhere, they don't go anywhere, they
don't get cast or copied or anything else to the function. The function
gets to refer to the identical object by a name local in that function;
you can see what that parameter's name is by the definition of the
function.
--
\ “Pray, v. To ask that the laws of the universe be annulled in |
`\ behalf of a single petitioner confessedly unworthy.” —Ambrose |
_o__) Bierce, _The Devil's Dictionary_, 1906 |
Ben Finney
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Question about Pass-by-object-reference? fl <rxjwg98@gmail.com> - 2014-07-22 12:04 -0700
Re: Question about Pass-by-object-reference? Ned Batchelder <ned@nedbatchelder.com> - 2014-07-22 15:32 -0400
Re: Question about Pass-by-object-reference? fl <rxjwg98@gmail.com> - 2014-07-22 12:54 -0700
Re: Question about Pass-by-object-reference? fl <rxjwg98@gmail.com> - 2014-07-22 12:34 -0700
Re: Question about Pass-by-object-reference? Peter Pearson <ppearson@nowhere.invalid> - 2014-07-22 20:35 +0000
Re: Question about Pass-by-object-reference? emile <emile@fenx.com> - 2014-07-22 13:46 -0700
Re: Question about Pass-by-object-reference? fl <rxjwg98@gmail.com> - 2014-07-22 15:17 -0700
Re: Question about Pass-by-object-reference? Joel Goldstick <joel.goldstick@gmail.com> - 2014-07-22 18:26 -0400
Re: Question about Pass-by-object-reference? emile <emile@fenx.com> - 2014-07-22 15:33 -0700
Re: Question about Pass-by-object-reference? Jerry Hill <malaclypse2@gmail.com> - 2014-07-22 19:06 -0400
Re: Question about Pass-by-object-reference? fl <rxjwg98@gmail.com> - 2014-07-22 15:31 -0700
Re: Question about Pass-by-object-reference? emile <emile@fenx.com> - 2014-07-22 15:40 -0700
Re: Question about Pass-by-object-reference? fl <rxjwg98@gmail.com> - 2014-07-22 16:00 -0700
Re: Question about Pass-by-object-reference? emile <emile@fenx.com> - 2014-07-22 16:10 -0700
Re: Question about Pass-by-object-reference? Terry Reedy <tjreedy@udel.edu> - 2014-07-22 20:27 -0400
Re: Question about Pass-by-object-reference? fl <rxjwg98@gmail.com> - 2014-07-22 18:49 -0700
Re: Question about Pass-by-object-reference? Ben Finney <ben+python@benfinney.id.au> - 2014-07-23 11:59 +1000
Re: Question about Pass-by-object-reference? Steven D'Aprano <steve@pearwood.info> - 2014-07-23 05:35 +0000
Re: Question about Pass-by-object-reference? Chris Angelico <rosuav@gmail.com> - 2014-07-23 16:07 +1000
Re: Question about Pass-by-object-reference? Ben Finney <ben+python@benfinney.id.au> - 2014-07-23 16:25 +1000
Re: Question about Pass-by-object-reference? Terry Reedy <tjreedy@udel.edu> - 2014-07-23 18:51 -0400
Re: Question about Pass-by-object-reference? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-24 03:22 +0000
Re: Question about Pass-by-object-reference? Steven D'Aprano <steve@pearwood.info> - 2014-07-24 05:05 +0000
Re: Question about Pass-by-object-reference? Steven D'Aprano <steve@pearwood.info> - 2014-07-23 05:36 +0000
Re: Question about Pass-by-object-reference? Terry Reedy <tjreedy@udel.edu> - 2014-07-23 18:32 -0400
Re: Question about Pass-by-object-reference? alex23 <wuwei23@gmail.com> - 2014-07-25 15:20 +1000
Re: Question about Pass-by-object-reference? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-23 01:56 +0000
csiph-web