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


Groups > comp.lang.python > #75100

Re: Question about Pass-by-object-reference?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.news.ox.ac.uk!news.ox.ac.uk!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.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; 'argument': 0.05; 'subject:Question': 0.07; '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; 'python': 0.11; 'def': 0.12; 'jan': 0.12; '23,': 0.16; 'assignments.': 0.16; 'b):': 0.16; 'bind': 0.16; "function's": 0.16; 'namespace,': 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; 'wrote:': 0.18; 'starts': 0.20; 'this?': 0.23; 'header:User- Agent:1': 0.23; 'pass': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; "d'aprano": 0.31; 'steven': 0.31; 'objects': 0.35; 'executing': 0.36; 'subject:?': 0.36; 'being': 0.38; 'to:addr:python-list': 0.38; 'rather': 0.38; 'does': 0.39; 'quote': 0.39; 'received:71': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'name': 0.63; 'jul': 0.74; 'received:fios.verizon.net': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Question about Pass-by-object-reference?
Date Wed, 23 Jul 2014 18:32:24 -0400
References <cc0616eb-642a-426c-a995-6665ee4c52b9@googlegroups.com> <mailman.12208.1406075253.18130.python-list@python.org> <53cf49e5$0$29897$c3e8da3$5496439d@news.astraweb.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-71-175-90-87.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
In-Reply-To <53cf49e5$0$29897$c3e8da3$5496439d@news.astraweb.com>
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.12249.1406154767.18130.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1406154767 news.xs4all.nl 2837 [2001:888:2000:d::a6]:48912
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:75100

Show key headers only | View raw


On 7/23/2014 1:36 AM, Steven D'Aprano wrote:
> On Tue, 22 Jul 2014 20:27:15 -0400, 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. Given
>>
>> def f(a, b): pass
>>
>> a call f(1, 'x') starts by executing
>>
>> a, b = 1, 'x'
>>
>> in the local namespace.  Nothing is being 'passed'.
>
>
> If nothing is being passed, how does the function know to bind 1 and 'x'
> to names a and b, rather than (say) this?
>
> a, b = 23, 'Surprise!"

To quote your other message, "Magic happens, and a result is returned."

-- 
Terry Jan Reedy

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


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