Can Python function return multiple data?

Chris Angelico rosuav at gmail.com
Wed Jun 3 21:52:16 EDT 2015


On Thu, Jun 4, 2015 at 11:30 AM, Dennis Lee Bieber
<wlfraed at ix.netcom.com> wrote:
> On Wed, 3 Jun 2015 15:28:56 -0700 (PDT), sohcahtoa82 at gmail.com declaimed
> the following:
>
>>
>>People actually argue that Python passes by value?  This is easily proven wrong by passing a mutable object to a function and changing it within the function.
>
>         Which only proves you passed a mutable object... Mutating the object
> means you've performed some operation that "goes inside the box".
>
>         Try assigning a new object to it rather than mutating it... IE; don't
> go inside the box, but try to change the box itself. Doesn't carry out --
> which is the traditional definition of pass-by-reference: assignment
> changes the passed-in-object.

So you've proven that Python doesn't pass by value, and that Python
doesn't pass by reference.

I'm still waiting for "pass-by-quantum-entanglement" to be a viable option.

ChrisA



More information about the Python-list mailing list