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: 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 Subject: Re: Question about Pass-by-object-reference? Date: Wed, 23 Jul 2014 18:32:24 -0400 References: <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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 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