Remix.run Logo
hirvi74 2 days ago

> # Python is pass-by-reference, what are the

> # implications of sorted() vs numbers.sort()?

I thought references were passed by value in languages like Python? I am not particularly fond of Python, so my experience with and knowledge of the language are quite limited. But, I understand what the question is asking: mutation vs. the creation of a new object.

minitech 2 days ago | parent [-]

Correct, it’s a common misconception/sloppy wording.

AdieuToLogic 2 days ago | parent [-]

A mental exercise I perform when "reference" is used in this context is to substitute it with "pointer." I find it clarifying and rarely, if ever, incorrect.