Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Can Python function return multiple data? Date: Thu, 04 Jun 2015 17:25:46 +0300 Organization: A noiseless patient Spider Lines: 24 Message-ID: <87a8wf5z4l.fsf@elektro.pacujo.net> References: <3bbe49da-e989-4a8c-a8a9-75d3a786f508@googlegroups.com> <557056f9$0$13009$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="b7cb1518d23ec19d482dcc9c31d30fdd"; logging-data="17220"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189NSLa5Emcq1Mxikzibe2H" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:S8AUW1C4IV1rO6c4+e7YBHYCmTk= sha1:CCAw8yofpfPbY1u+YZRd7wuhc4Q= Xref: csiph.com comp.lang.python:92060 Steven D'Aprano : > But you still find a few people here and there who have been exposed > to Java foolishness, and will argue that Python is "pass by value, > where the value is an implementation dependent reference to the thing > that you thought was the value". Why fight terminology? Definitions can't be proved right or wrong. Anyway, I would say Python definitely is in the classic pass-by-value camp. Here's a simple test: def f(x): x = 3 y = 1 f(y) print(y) If it prints 1, it's pass by value. If it prints 3, it's pass by reference. Marko