Can Python function return multiple data?

Alain Ketterlin alain at universite-de-strasbourg.fr.invalid
Thu Jun 4 14:17:17 EDT 2015


Steven D'Aprano <steve at pearwood.info> writes:

[...]
> 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".

I find this clear and concise. Can you exhibit an example that would not
match this description?

> In other words, according to this Java philosophy, following `x = 23`, the
> value of x is not 23 like any sane person would expect, but some invisible
> and unknown, and unknowable, reference to 23.

No, Java doesn't work like that for primitive types (assuming that by
"Java" you mean the language and execution environment defined in
reference documents).

-- Alain.



More information about the Python-list mailing list